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

Cypress crashes: TypeError: Cannot read property '0' of null #841

Closed
bahmutov opened this issue Oct 27, 2017 · 7 comments
Closed

Cypress crashes: TypeError: Cannot read property '0' of null #841

bahmutov opened this issue Oct 27, 2017 · 7 comments
Assignees
Labels
CI General issues involving running in a CI provider OS: linux pkg/server This is due to an issue in the packages/server directory type: bug
Milestone

Comments

@bahmutov
Copy link
Contributor

bug

version

Cypress 1.0.1 on Linux

When @jennifer-shehane changed her GitHub email, Cypress run started crashing trying to parse the commit author line (in several projects).

Opening Cypress...
TypeError: Cannot read property '0' of null
    at Function.module.exports.Commit.actor (/root/cypress-dashboard/node_modules/cypress/dist/Cypress/resources/app/packages/server/node_modules/gift/lib/commit.js:176:56)
    at Function.module.exports.Commit.parse_commits (/root/cypress-dashboard/node_modules/cypress/dist/Cypress/resources/app/packages/server/node_modules/gift/lib/commit.js:139:21)
    at /root/cypress-dashboard/node_modules/cypress/dist/Cypress/resources/app/packages/server/node_modules/gift/lib/commit.js:99:39
    at ChildProcess.exithandler (child_process.js:209:7)

The crash happens inside gift package at line that tries to parse author line

ref1 = this.actor(author_line), author = ref1[0], authored_date = ref1[1];

We need to handle the crash.

@bahmutov bahmutov self-assigned this Oct 27, 2017
@bahmutov bahmutov added CI: circle OS: linux pkg/server This is due to an issue in the packages/server directory stage: investigating Someone from Cypress is looking into this type: bug labels Oct 27, 2017
@brian-mann
Copy link
Member

Oh good find. Is the problem inside of gift? Are there updates available? Would you prefer to switch to a different git lib?

@bahmutov
Copy link
Contributor Author

gift v0.10.0 has same problems, seems it is getting confused parsing the following commit message

commit 2a4d33f2104429f9709a54c6a88f0c7b13d10fee
tree dcbaa9b08b5ebba0b83b0221f9411643b45d549e
parent a805a981f953b1db98fd7025743c48491e59ba3d
author Jennifer Shehane <jennifermann17@gmail.com> 1509134693 -0400
committer GitHub <noreply@github.com> 1509134693 -0400
gpgsig -----BEGIN PGP SIGNATURE-----
 
 wsBcBAABC...
 =GKAb
 -----END PGP SIGNATURE-----
 

    update description in README


@bahmutov
Copy link
Contributor Author

And does not fail when parsing commit without pgp signature?

commit 3612e16e15f55b4df27fc739b1c88d46c30a8e4f
tree 4addedb156df7034503ef2c5cf68b837f39a8d0c
parent 0aa2fa2092e8d5701bbbdc18ebc109bac66755e4
parent d78945a76910481c7015ea6d3d57fa6d10b94a65
author Brian Mann <brian@cypress.io> 1492208896 -0400
committer GitHub <noreply@github.com> 1492208896 -0400

    Merge pull request #8 from cypress-io/CYP-838-new-tree-traversal-commands
    
    Added examples for newly added traversal commands.


@bahmutov
Copy link
Contributor Author

bahmutov commented Oct 27, 2017

Seems gift does not account for extra space line after PGP signature. For example lines with PGP signature have extra ' ' line between signature and message.

read PGP signature
[ '-----BEGIN PGP SIGNATURE-----',
  ' ',
  ' wsBcBA...
  ' =GKAb',
  ' -----END PGP SIGNATURE-----' ]
after reading PGP sign lines
[ ' ', '', '    update description in README', '', '' ]
after reading message
[]

Notice that after reading signature the text lines are still , ``, update ...
and reading message fails.

@bahmutov
Copy link
Contributor Author

work around for now - disable PGP signature :(

@pawelgalazka
Copy link

Can confirm, version 1.0.3 fixed the issue. Thanks for fast reaction 👍

@brian-mann
Copy link
Member

Fixed in 1.0.3.

@jennifer-shehane jennifer-shehane changed the title Cypress crashes if author of commit changes GitHub email Cypress crashes: TypeError: Cannot read property '0' of null Nov 9, 2017
@jennifer-shehane jennifer-shehane removed stage: investigating Someone from Cypress is looking into this labels Jan 16, 2019
@jennifer-shehane jennifer-shehane added CI General issues involving running in a CI provider and removed CI: circle labels Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI General issues involving running in a CI provider OS: linux pkg/server This is due to an issue in the packages/server directory type: bug
Projects
None yet
Development

No branches or pull requests

4 participants