danger-periphery icon indicating copy to clipboard operation
danger-periphery copied to clipboard

Danger::DSLError scan exited with status code .

Open fepersembe opened this issue 1 year ago • 7 comments

I am trying to run periphery 3.0.1 as it is the only version that support new Xcode 16 folder structure. But getting an error, when I run the same command on my local and it seems to work without an issue. But in plugin the execution does not start at all, I guess it is something with parameters (Tried using index_store_path as an array too but no luck)

Any suggestions would be very nice.

Here is my code in dangerfile:

      periphery.scan_all_files = false
      periphery.format = "checkstyle"
      periphery.scan(
         project: 'PROJECT.xcworkspace',
         schemes: "SCHEME",
         skip_build: true,
         index_store_path: "#{derived_data_path}/Index.noindex/DataStore",
         verbose: true
      )

Here is the error log:

[!] The exception involves the following plugins:
 -  danger-periphery
bundler: failed to load command: danger (/Users/ec2-user/.rbenv/versions/3.3.4/bin/danger)
/Users/ec2-user/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/danger-periphery-0.4.0/lib/periphery/runner.rb:18:in `scan':  (Danger::DSLError)
[!] Invalid `Dangerfile.postbuild` file: error: ["periphery", "scan", "--project", "PROJECT.xcworkspace", "--schemes", "dev", "--skip-build", "--index-store-path", "/Users/ec2-user/Library/Developer/Xcode/DerivedData/PROJECT-evthidptophhcdflxopqfndmkzkv/Index.noindex/DataStore", "--verbose", "--disable-update-check", "--quiet", "--format", "json"] exited with status code . 
 #  from Dangerfile.postbuild:48
 #  -------------------------------------------
 #        periphery.format = "json"
 >        periphery.scan(
 #           project: 'PROJECT.xcworkspace',
 #  -------------------------------------------
	from /Users/ec2-user/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/danger-periphery-0.4.0/lib/danger/danger_periphery.rb:78:in `scan'
	from Dangerfile.postbuild:48:in `eval_file'
	from /Users/ec2-user/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:311:in `eval'
	from /Users/ec2-user/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:311:in `eval_file'
	from /Users/ec2-user/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:204:in `block in parse'

fepersembe avatar Dec 29 '24 19:12 fepersembe

@fepersembe

I couldn't reproduce the problem. I don't know the root cause but at least it's not related to #268 because danger-periphery 0.4.0 is still compatible with Periphery 3.0.1.

According to the error message, the command didn't return an exit status. This means the command terminated abnormally, likely killed by another process (e.g., OOM killer).

manicmaniac avatar Jan 10 '25 02:01 manicmaniac

@fepersembe

Since v0.5.0, danger-periphery raises an error when its subprocess is terminated by a signal. (ref: #286)

Please update to the latest version and provide the execution log if you are still experiencing the issue.

manicmaniac avatar Feb 16 '25 19:02 manicmaniac

@manicmaniac Thanks for the update, I will try and return as soon as possible.

fepersembe avatar Feb 16 '25 20:02 fepersembe

Seeing the same issue when trying to update to Periphery 3.0.2

[!] The exception involves the following plugins:
 -  danger-periphery

bundler: failed to load command: danger (/Users/distiller/project/vendor/bundle/ruby/3.3.0/bin/danger)
/Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-periphery-0.5.0/lib/periphery/runner.rb:82:in `validate_subprocess_status!':  (Danger::DSLError)
[!] Invalid `Dangerfile` file: error: ["/Users/distiller/project/periphery", "scan", "--project", "PROJECT.xcodeproj", "--schemes", "SCHEME", "--skip-build", "--index-store-path", "../Library/Developer/Xcode/DerivedData/PROJECT-cjhoiejdqroxpdaioyirhlrsqcii/Index.noindex/DataStore", "--disable-update-check", "--quiet", "--format", "checkstyle"] was terminated by SIGSEGV
 #  from Dangerfile:112
 #  -------------------------------------------
 #          if File.exist?(complete_path)
 >            periphery.scan(
 #              project: "PROJECT.xcodeproj",
 #  -------------------------------------------

        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-periphery-0.5.0/lib/periphery/runner.rb:20:in `scan'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-periphery-0.5.0/lib/danger/danger_periphery.rb:88:in `scan'
        from Dangerfile:112:in `block in eval_file'
        from Dangerfile:109:in `each'
        from Dangerfile:109:in `eval_file'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:311:in `eval'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:311:in `eval_file'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:204:in `block in parse'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:201:in `instance_eval'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:201:in `parse'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:287:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/executor.rb:28:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/commands/runner.rb:73:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/bin/danger:5:in `<top (required)>'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/bin/danger:25:in `load'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/bin/danger:25:in `<top (required)>'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `load'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `kernel_load'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:23:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli.rb:452:in `exec'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli.rb:35:in `dispatch'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli.rb:29:in `start'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/exe/bundle:28:in `block in <top (required)>'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/exe/bundle:20:in `<top (required)>'
        from /Users/distiller/.rbenv/versions/3.3.5/bin/bundle:25:in `load'
        from /Users/distiller/.rbenv/versions/3.3.5/bin/bundle:25:in `<main>'
/Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-periphery-0.5.0/lib/periphery/runner.rb:82:in `validate_subprocess_status!': error: ["/Users/distiller/project/periphery", "scan", "--project", "PROJECT.xcodeproj", "--schemes", "SCHEME", "--skip-build", "--index-store-path", "../Library/Developer/Xcode/DerivedData/PROJECT-cjhoiejdqroxpdaioyirhlrsqcii/Index.noindex/DataStore", "--disable-update-check", "--quiet", "--format", "checkstyle"] was terminated by SIGSEGV (RuntimeError)
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-periphery-0.5.0/lib/periphery/runner.rb:20:in `scan'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-periphery-0.5.0/lib/danger/danger_periphery.rb:88:in `scan'
        from Dangerfile:112:in `block in eval_file'
        from Dangerfile:109:in `each'
        from Dangerfile:109:in `eval_file'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:311:in `eval'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:311:in `eval_file'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:204:in `block in parse'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:201:in `instance_eval'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:201:in `parse'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/dangerfile.rb:287:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/danger_core/executor.rb:28:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/lib/danger/commands/runner.rb:73:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/danger-9.5.1/bin/danger:5:in `<top (required)>'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/bin/danger:25:in `load'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/bin/danger:25:in `<top (required)>'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `load'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `kernel_load'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:23:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli.rb:452:in `exec'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli.rb:35:in `dispatch'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/cli.rb:29:in `start'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/exe/bundle:28:in `block in <top (required)>'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
        from /Users/distiller/project/vendor/bundle/ruby/3.3.0/gems/bundler-2.6.3/exe/bundle:20:in `<top (required)>'
        from /Users/distiller/.rbenv/versions/3.3.5/bin/bundle:25:in `load'
        from /Users/distiller/.rbenv/versions/3.3.5/bin/bundle:25:in `<main>'

Exited with code exit status 1

neilsardesai avatar Mar 03 '25 17:03 neilsardesai

@neilsardesai Apparently it's not the same problem.

[!] Invalid Dangerfile file: error: ["/Users/distiller/project/periphery", "scan", "--project", "PROJECT.xcodeproj", "--schemes", "SCHEME", "--skip-build", "--index-store-path", "../Library/Developer/Xcode/DerivedData/PROJECT-cjhoiejdqroxpdaioyirhlrsqcii/Index.noindex/DataStore", "--disable-update-check", "--quiet", "--format", "checkstyle"] was terminated by SIGSEGV

It means Periphery dies due to segmentation fault. There's nothing danger-periphery can do.

manicmaniac avatar Mar 12 '25 23:03 manicmaniac

@neilsardesai Apparently it's not the same problem.

[!] Invalid Dangerfile file: error: ["/Users/distiller/project/periphery", "scan", "--project", "PROJECT.xcodeproj", "--schemes", "SCHEME", "--skip-build", "--index-store-path", "../Library/Developer/Xcode/DerivedData/PROJECT-cjhoiejdqroxpdaioyirhlrsqcii/Index.noindex/DataStore", "--disable-update-check", "--quiet", "--format", "checkstyle"] was terminated by SIGSEGV

It means Periphery dies due to segmentation fault. There's nothing danger-periphery can do.

Ah I see. I wonder if it’s related to this issue 🤔 https://github.com/peripheryapp/periphery/issues/885

neilsardesai avatar Mar 13 '25 13:03 neilsardesai

Looks like the issue I was having was resolved in Periphery 3.0.3

neilsardesai avatar Mar 17 '25 13:03 neilsardesai