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

bug: crashed while running rover subgraph introspect #670

Closed
mziwisky opened this issue Jul 8, 2021 · 7 comments · Fixed by #731
Closed

bug: crashed while running rover subgraph introspect #670

mziwisky opened this issue Jul 8, 2021 · 7 comments · Fixed by #731
Assignees
Milestone

Comments

@mziwisky
Copy link

mziwisky commented Jul 8, 2021

following https://www.apollographql.com/docs/federation/quickstart/, got to the part that says to run rover subgraph introspect https://rover.apollo.dev/quickstart/products/graphql, it crashes without much help.

Crash Report

name = 'rover'
operating_system = 'unix:OSX'
crate_version = '0.1.7'
explanation = '''
Panic occurred in file '/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/git-url-parse-0.3.1/src/lib.rs' at line 237
'''
cause = 'index out of bounds: the len is 1 but the index is 1'
method = 'Panic'
backtrace = '''

  0: 0x10a6b85fa - __mh_execute_header
  1: 0x10a70378f - __mh_execute_header
  2: 0x10a703756 - __mh_execute_header
  3: 0x1093c0421 - __mh_execute_header
  4: 0x10936bd48 - __mh_execute_header
  5: 0x10936b4c2 - __mh_execute_header
  6: 0x10937362a - __mh_execute_header
  7: 0x109373dbc - __mh_execute_header
  8: 0x10930f1a7 - __mh_execute_header
  9: 0x10930d90a - __mh_execute_header
 10: 0x10930d92c - __mh_execute_header
 11: 0x10a6b8fa1 - __mh_execute_header
 12: 0x10930f929 - __mh_execute_header'''
@mziwisky
Copy link
Author

mziwisky commented Jul 8, 2021

aha, so i see the expression splitpath[1] at https://github.com/tjtelan/git-url-parse-rs/blob/v0.3.1/src/lib.rs#L237 is the out of bounds access. and when i run the rover command with -l debug, i see it's trying to parse the origin git remote of my current directory for some reason, and it's failing because that parsing library doesn't know how to handle ssh host aliases, which i happen to be using here

$ git remote -v
origin	gerrit:apollo-gateway (fetch)
origin	gerrit:apollo-gateway (push)
$ cat ~/.ssh/config
Host gerrit
  HostName gerrit.instructure.com
  User mziwisky
  Port 29418

so i guess i have workarounds -- change my origin to not use an alias, or just cd out of the repository -- but why does rover subgraph introspect care about the remotes of the git repository associated with my working directory anyway?

@mziwisky
Copy link
Author

mziwisky commented Jul 8, 2021

huh, maybe i only have the cd workaround after all -- even when i expand my remote to ssh://mziwisky@gerrit.instructure.com:29418/apollo-gateway, i get the same crash. apparently the git url parsing lib fails on this valid remote as well.

@mziwisky
Copy link
Author

looks like this is the same as #665 -- git-url-parse-rs assumes a git url's path has at least (or perhaps exactly) two levels to it (i.e. there's a slash in it), but this tends not to be the case with gerrit. gerrit URLs tend to have just one level after the slash.

@abernix abernix added triage issues and PRs that need to be triaged bug 🐞 labels Jul 20, 2021
@abernix
Copy link
Member

abernix commented Jul 21, 2021

Copying the report from @oliyoung in #665 (comment):

Trying to replace npx apollo service:push with rover and getting repeated failures, on traced logs, it's probably somewhere here since we run git via Gerrit internally (where xxxx.yyyy is a valid fqdn to our Gerrit repo)

  DEBUGgit_url_parse: Processing: "ssh://oli.young@gerrit.xxxx.yyyy:700/zzzz"
    at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/git-url-parse-0.3.1/src/lib.rs:339

  DEBUGgit_url_parse: The urlpath: "xxxx"
    at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/git-url-parse-0.3.1/src/lib.rs:170

  DEBUGgit_url_parse: rsplit results for metadata: ["xxxx"]
    at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/git-url-parse-0.3.1/src/lib.rs:180

Crash Report

name = 'rover'
operating_system = 'unix:OSX'
crate_version = '0.1.7'
explanation = '''
Panic occurred in file '/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/git-url-parse-0.3.1/src/lib.rs' at line 237
'''
cause = 'index out of bounds: the len is 1 but the index is 1'
method = 'Panic'
backtrace = '''

  0: 0x10bc075fa - __mh_execute_header
  1: 0x10bc5278f - __mh_execute_header
  2: 0x10bc52756 - __mh_execute_header
  3: 0x10a90f421 - __mh_execute_header
  4: 0x10a8bad48 - __mh_execute_header
  5: 0x10a8ba4c2 - __mh_execute_header
  6: 0x10a8c262a - __mh_execute_header
  7: 0x10a8c2b86 - __mh_execute_header
  8: 0x10a85e1a7 - __mh_execute_header
  9: 0x10a85c90a - __mh_execute_header
 10: 0x10a85c92c - __mh_execute_header
 11: 0x10bc07fa1 - __mh_execute_header
 12: 0x10a85e929 - __mh_execute_header'''

@mziwisky
Copy link
Author

thanks @EverlastingBugstopper, looks like this is fixed, in that commands no longer fail in the context of an unexpected git remote URL, but it does still spit out the error message:

$ rover --version
Rover 0.2.0

$ git remote -v
origin	ssh://mziwisky@gerrit.instructure.com:29418/inst-api-gateway (fetch)
origin	ssh://mziwisky@gerrit.instructure.com:29418/inst-api-gateway (push)

$ rover subgraph list Z-Test-Graph
Houston, we have a problem. Rover crashed!
To help us diagnose the problem you can send us a crash report.

You can submit an issue with the crash report at this link: https://github.com/apollographql/rover/issues/new?title=bug%3A+crashed+while+%3Cinsert+description+here%3E&body=%3C%21--%0A++Please+add+some+additional+information+about+what+you+were+trying+to+do+before+submitting+this+report%0A+--%3E+%0A%0A%23%23+Description%0ADescribe+the+issue+that+you%27re+seeing.%0A%0A**Crash+Report**%0A+%60%60%60toml%0Aname+%3D+%27rover%27%0Aoperating_system+%3D+%27unix%3AOSX%27%0Acrate_version+%3D+%270.2.0%27%0Aexplanation+%3D+%27%27%27%0APanic+occurred+in+file+%27%2FUsers%2Frunner%2F.cargo%2Fregistry%2Fsrc%2Fgithub.com-1ecc6299db9ec823%2Fgit-url-parse-0.3.1%2Fsrc%2Flib.rs%27+at+line+237%0A%27%27%27%0Acause+%3D+%27index+out+of+bounds%3A+the+len+is+1+but+the+index+is+1%27%0Amethod+%3D+%27Panic%27%0Abacktrace+%3D+%27%27%27%0A%0A+++0%3A+0x10923fd2a+-+__mh_execute_header%0A+++1%3A+0x109289c3f+-+__mh_execute_header%0A+++2%3A+0x109289c06+-+__mh_execute_header%0A+++3%3A+0x108dc7081+-+__mh_execute_header%0A+++4%3A+0x108d900f3+-+__mh_execute_header%0A+++5%3A+0x107f6fdff+-+__mh_execute_header%0A+++6%3A+0x107f6e811+-+__mh_execute_header%0A+++7%3A+0x107f6de60+-+__mh_execute_header%0A+++8%3A+0x107f25f09+-+__mh_execute_header%0A+++9%3A+0x107f2548a+-+__mh_execute_header%0A++10%3A+0x107f254ac+-+__mh_execute_header%0A++11%3A+0x109240841+-+__mh_execute_header%0A++12%3A+0x107f261b9+-+__mh_execute_header%27%27%27%0A%0A%60%60%60%0A&labels=bug+%F0%9F%90%9E%2C+triage&template=bug_report.md

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thanks for your patience!
Listing subgraphs for Z-Test-Graph@current using credentials from the default profile.
┌─────────────┬─────────────────────────────────────────────────────┬────────────────────────────┐
│    Name     │                     Routing Url                     │        Last Updated        │
├─────────────┼─────────────────────────────────────────────────────┼────────────────────────────┤
│ hello_world │ http://subgraph:4456/graphql                        │ 2021-08-06 11:02:18 -07:00 │
├─────────────┼─────────────────────────────────────────────────────┼────────────────────────────┤
│ canvas      │ http://hostmachine.docker:3000/api/graphql/subgraph │ 2021-07-31 13:38:21 -07:00 │
└─────────────┴─────────────────────────────────────────────────────┴────────────────────────────┘

View full details at https://studio.apollographql.com/graph/Z-Test-Graph/service-list

@EverlastingBugstopper
Copy link
Contributor

EverlastingBugstopper commented Aug 24, 2021

Ah! That's unfortunate - I wrote a test to make sure it didn't panic, but never tested things end to end (clearly!) I have a fix for this in this PR that no longer prints the crash message to your terminal - it will be included in the next release, thanks for the report!

@EverlastingBugstopper
Copy link
Contributor

Hey @mziwisky - this has been patched in v0.2.1 😄

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

Successfully merging a pull request may close this issue.

3 participants