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

react-native-git-upgrade fails on git diff --binary HEAD~1 HEAD #12336

Closed
macnube opened this issue Feb 10, 2017 · 4 comments
Closed

react-native-git-upgrade fails on git diff --binary HEAD~1 HEAD #12336

macnube opened this issue Feb 10, 2017 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@macnube
Copy link

macnube commented Feb 10, 2017

Description

Attempting to upgrade react native from 0.38.0 to 0.39.2 using react-native-git-upgrade 0.39.2

Reproduction

react-native-git-upgrade 0.39.2
git-upgrade info Check for updates 
git-upgrade info Read package.json files 
git-upgrade info Check declared version 
git-upgrade info Check matching versions 
git-upgrade info Check React peer dependency 
git-upgrade info Check that Git is installed 
git-upgrade info Get information from NPM registry 
git-upgrade info Upgrading to React Native 0.39.2, React ~15.4.0-rc.4 
git-upgrade info Setup temporary working directory 
git-upgrade info Configure Git environment 
git-upgrade info Init Git repository 
git-upgrade info Add all files to commit 
git-upgrade info Commit current project sources 
git-upgrade info Create a tag before updating sources 
git-upgrade info Generate old version template 
git-upgrade info Add updated files to commit 
git-upgrade info Commit old version template 
git-upgrade info Install the new version 
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
git-upgrade info Generate new version template 
git-upgrade info Add updated files to commit 
git-upgrade info Commit new version template 
git-upgrade info Generate the patch between the 2 versions 
git-upgrade ERR! An error occurred during upgrade: 
git-upgrade ERR! Error: Command 'git diff --binary HEAD~1 HEAD' exited with code null:
stderr: undefined

Solution

No idea!

Additional Information

  • React Native version: 0.38.0
  • Platform: N/A
  • Operating System: MacOS 10.12.3
@lacker
Copy link
Contributor

lacker commented Feb 10, 2017

Does this happen on a fresh 0.38.0 install?

@ncuillery
Copy link
Contributor

ncuillery commented Feb 13, 2017

From https://nodejs.org/api/child_process.html#child_process_event_exit:

If the process exited, code is the final exit code of the process, otherwise null. If the process terminated due to receipt of a signal, signal is the string name of the signal, otherwise null. One of the two will always be non-null.

It means that the diff command's process hasn't exited on its own, it has been terminated by a signal.

@macnube Do you see a reason to have this process killed by a signal on your machine (Ctrl-C, watchdog or whatever)? Does it happen every time ?

Anyway, it could be a good idea to improve the debug information in the exec function:

  • exited with code ${code} if code is not null
  • exited by signal ${signal} if signal is not null

@macnube
Copy link
Author

macnube commented Feb 13, 2017

@lacker You know, I think this may have been an install that I downgraded back to 0.38.0 at some point because I was running into some other issues. I'll see what happens if I start from a fresh install with the project.

@ncuillery Nothing comes to mind and it was happening every time, though admittedly I didn't more than 5 times. With the extra info you've provided, I'll keep an eye out to see if I can find the culprit and will report back soon.

@macnube
Copy link
Author

macnube commented Mar 17, 2017

I did a clean install and now I'm running on the latest.

@macnube macnube closed this as completed Mar 17, 2017
facebook-github-bot pushed a commit that referenced this issue Nov 21, 2017
Summary:
When performing an upgrade using react-native-git-upgrade git can fail with a signal, however, only exit codes are accounted for.

Related issue: #12336

In my case, Git fails with a `SIGPIPE` signal - have not figured out why yet, but that's a separate issue. Before, since exit code was not zero, the console would default to the error case, but since no exit code was supplied, the error message was meaningless - `exited with code null`. Now, it errors out with `terminated with signal 'SIGPIPE'`, while still taking account of exit codes. Quoting [nodejs docs](https://nodejs.org/api/child_process.html#child_process_event_exit):

> The 'exit' event is emitted after the child process ends. If the process exited, code is the final exit code of the process, otherwise null. If the process terminated due to receipt of a signal, signal is the string name of the signal, otherwise null. One of the two will always be non-null.

I would be happy to write a test case for this but I haven't seen any react-native-git-upgrade ones?

[CLI] [ENHANCEMENT] [react-native/react-native-git-upgrade] - Git terminated by signal error message
Closes #16822

Differential Revision: D6387451

Pulled By: shergin

fbshipit-source-id: 25bf9dabdb5fda70d220bcd5f14c3c92bba8c3d4
bowerman0 pushed a commit to bowerman0/react-native that referenced this issue Dec 5, 2017
Summary:
When performing an upgrade using react-native-git-upgrade git can fail with a signal, however, only exit codes are accounted for.

Related issue: facebook#12336

In my case, Git fails with a `SIGPIPE` signal - have not figured out why yet, but that's a separate issue. Before, since exit code was not zero, the console would default to the error case, but since no exit code was supplied, the error message was meaningless - `exited with code null`. Now, it errors out with `terminated with signal 'SIGPIPE'`, while still taking account of exit codes. Quoting [nodejs docs](https://nodejs.org/api/child_process.html#child_process_event_exit):

> The 'exit' event is emitted after the child process ends. If the process exited, code is the final exit code of the process, otherwise null. If the process terminated due to receipt of a signal, signal is the string name of the signal, otherwise null. One of the two will always be non-null.

I would be happy to write a test case for this but I haven't seen any react-native-git-upgrade ones?

[CLI] [ENHANCEMENT] [react-native/react-native-git-upgrade] - Git terminated by signal error message
Closes facebook#16822

Differential Revision: D6387451

Pulled By: shergin

fbshipit-source-id: 25bf9dabdb5fda70d220bcd5f14c3c92bba8c3d4
bowerman0 pushed a commit to bowerman0/react-native that referenced this issue Dec 5, 2017
Summary:
When performing an upgrade using react-native-git-upgrade git can fail with a signal, however, only exit codes are accounted for.

Related issue: facebook#12336

In my case, Git fails with a `SIGPIPE` signal - have not figured out why yet, but that's a separate issue. Before, since exit code was not zero, the console would default to the error case, but since no exit code was supplied, the error message was meaningless - `exited with code null`. Now, it errors out with `terminated with signal 'SIGPIPE'`, while still taking account of exit codes. Quoting [nodejs docs](https://nodejs.org/api/child_process.html#child_process_event_exit):

> The 'exit' event is emitted after the child process ends. If the process exited, code is the final exit code of the process, otherwise null. If the process terminated due to receipt of a signal, signal is the string name of the signal, otherwise null. One of the two will always be non-null.

I would be happy to write a test case for this but I haven't seen any react-native-git-upgrade ones?

[CLI] [ENHANCEMENT] [react-native/react-native-git-upgrade] - Git terminated by signal error message
Closes facebook#16822

Differential Revision: D6387451

Pulled By: shergin

fbshipit-source-id: 25bf9dabdb5fda70d220bcd5f14c3c92bba8c3d4
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants