Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell command exited with exit status 1 instead of 0. git_add action #20624

Open
4 tasks done
Dat-Mobile opened this issue Sep 6, 2022 · 10 comments
Open
4 tasks done

Comments

@Dat-Mobile
Copy link

New Issue Checklist

Issue Description

git checkout [branch] success but
git_add return the error, only on iOS lane, whereas Android lane works fine:

Shell command exited with exit status 1 instead of 0

Command executed

git_add

Complete output when running fastlane, including the stack trace and command used
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
[02:39:41]: ---------------------
[02:39:41]: --- Step: git_add ---
[02:39:41]: ---------------------
+---------------------------+--------------------------------------------------------+
|                                    Lane Context                                    |
+---------------------------+--------------------------------------------------------+
| DEFAULT_PLATFORM          | ios                                                    |
| PLATFORM_NAME             | ios                                                    |
| LANE_NAME                 | ios beta                                               |
| KEYCHAIN_PATH             | ~/Library/Keychains/fastlane_tmp_keychain              |
| ORIGINAL_DEFAULT_KEYCHAIN | "/Users/distiller/Library/Keychains/login.keychain-db" |
| LATEST_BUILD_NUMBER       | 49                                                     |
| LATEST_VERSION            | 1.0.1                                                  |
| VERSION_NUMBER            | 1.0.1                                                  |
+---------------------------+--------------------------------------------------------+
[02:39:41]: Shell command exited with exit status 1 instead of 0.
  

Environment

| Gem      | Version | Update-Status |
| -------- | ------- | ------------- |
| fastlane | 2.209.1 | ✅ Up-To-Date  | 
@fastlane-bot
Copy link

It seems like you have not included the output of fastlane env
To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env 👍

@dnlfrst
Copy link

dnlfrst commented Oct 6, 2022

Came across this error as well having the following stack trace:

Output
/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': \e[31m[!] Shell command exited with exit status 1 instead of 0.\e[0m (FastlaneCore::Interface::FastlaneShellError)
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/helper/sh_helper.rb:12:in `sh'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/actions/git_add.rb:20:in `run'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:229:in `chdir'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
        from Fastfile:39:in `block (2 levels) in parsing_binding'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/lane.rb:33:in `call'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:45:in `execute'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/commands_generator.rb:354:in `run'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/bin/fastlane:23:in `<top (required)>'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/bin/fastlane:25:in `load'
        from /usr/local/Cellar/fastlane/2.210.1/libexec/bin/fastlane:25:in `<main>'

Fixed it by removing the path argument from the call to git_add. Didn't have any escapes or wildcards in the paths but didn't try to use shell_escape: false either.

@Dat-Mobile
Copy link
Author

how you fix it @dnlfrst ?

@dnlfrst
Copy link

dnlfrst commented Oct 6, 2022

Instead of doing

git_add(path: ["...", "...", "..."])

I just did

git_add

and matched the relevant files with git_commit instead.

@Dat-Mobile
Copy link
Author

Dat-Mobile commented Oct 7, 2022

I simply use git_add and it failed

I think it's because fastlane run inside android/ or ios/ cause the problem

@Dat-Mobile
Copy link
Author

@dnlfrst for me git_add is ok for files inside android/ or ios/ corresponse to which lane it is running, but it cannot add file inside src/ folder

my project is React native. I think it always see android/ ios/ as root folder

@TartanLeGrand
Copy link

Hi 👋, I'm sorry I'm a bit late. But I have the same error but using setup_ci in a Gitlab runner. I looked at #21122 thread and indeed the way I had configured my runner was not the right one I just changed the SessionCreate from false to true and it now works

@Dat-Mobile
Copy link
Author

my problem is git_add just doesn't include file from src folder which is same level with android and ios

@IDEAL-YANG
Copy link

Hi,I have same problem. But I fix it. Because I add path appear in .gitignore file for me. It cause git add failure. Hope it can help you.

@Dat-Mobile
Copy link
Author

@IDEAL-YANG my file path isn't in .gitignore file

I might close this issue because I don't git_add it anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants