You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by "Bruno-DaSilva (via GitHub)" <gi...@apache.org> on 2023/11/23 21:31:52 UTC
[I] [Bug][Github Plugin] Panic during github_graphql task, specifically when grabbing deployments [incubator-devlake]
Bruno-DaSilva opened a new issue, #6510:
URL: https://github.com/apache/incubator-devlake/issues/6510
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar issues.
### What happened
When obtaining github data from my private repo, the devlake process crashes with a panic.
Based on where it is in the logs, this seems to happen on the second graphql query as part of `CollectAndExtractDeployments`.
Based on the stacktrace, this presumably happens because we are passing `nil` and `nil` as query variables to the graphql query library. This nil seems to come from BuildQuery within github deployment parsing code
https://github.com/apache/incubator-devlake/blob/df1a1b9288f8fb29c6733aad220dd94cdb332f3d/backend/plugins/github_graphql/tasks/deployment_collector_extractor.go#L112-L115
Full stacktrace:
```
[signal SIGSEGV: segmentation violation code=0x1 addr=0x98 pc=0x7f6867667841]
goroutine 2277 [running]:
github.com/merico-dev/graphql.writeQuery({0x1aa4a40, 0xc00159f6b0}, {0x0, 0x0?}, 0x0, 0xbecda0?)
/go/pkg/mod/github.com/merico-dev/graphql@v0.0.0-20221027131946-77460a1fd4cd/query.go:112 +0x61
github.com/merico-dev/graphql.query({0x0, 0x0}, 0x227?)
/go/pkg/mod/github.com/merico-dev/graphql@v0.0.0-20221027131946-77460a1fd4cd/query.go:105 +0x7f
github.com/merico-dev/graphql.ConstructQuery({0x0?, 0x0?}, 0x0)
/go/pkg/mod/github.com/merico-dev/graphql@v0.0.0-20221027131946-77460a1fd4cd/query.go:16 +0x46
github.com/merico-dev/graphql.(*Client).Query(0xc0014c9728?, {0x1ab4248, 0xc0015ed630}, {0x0, 0x0}, 0x0?)
/go/pkg/mod/github.com/merico-dev/graphql@v0.0.0-20221027131946-77460a1fd4cd/graphql.go:38 +0x5f
github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*GraphqlAsyncClient).Query(0xc0015aa780, {0x0, 0x0}, 0x0)
/app/helpers/pluginhelper/api/graphql_async_client.go:167 +0x2be
github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*GraphqlCollector).fetchAsync(0xc0021acc90, 0x0?, 0xc00211e6d8?, 0xc0014e85d0)
/app/helpers/pluginhelper/api/graphql_collector.go:379 +0x252
github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*GraphqlCollector).fetchOneByOne.func1.1()
/app/helpers/pluginhelper/api/graphql_collector.go:253 +0x12d
github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*GraphqlAsyncClient).NextTick.func1.1()
/app/helpers/pluginhelper/api/graphql_async_client.go:206 +0x6b
created by github.com/apache/incubator-devlake/helpers/pluginhelper/api.(*GraphqlAsyncClient).NextTick.func1
/app/helpers/pluginhelper/api/graphql_async_client.go:201 +0xbf
```
### What do you expect to happen
The import task to complete successfully.
### How to reproduce
I'm not 100% sure what the requirement on the state of the repo is, the enableSince is used for paging? So a repo with a sufficiently long list of deployments to exceed the size of a single page should be able to reproduce this?
But basically, setup
1. github repo connector with CI/CD scope enabled
2. create project that uses that connector
3. click 'collect data'
4. observe 'task failed, the process was terminated unexpectedly' error in the UI during the `github_graphql` task.
5. observe the above stacktrace in the logs of the devlake-lake process.
### Anything else
_No response_
### Version
v0.20.0-beta2
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Github Plugin] Panic during github_graphql task, specifically when grabbing deployments [incubator-devlake]
Posted by "Bruno-DaSilva (via GitHub)" <gi...@apache.org>.
Bruno-DaSilva commented on issue #6510:
URL: https://github.com/apache/incubator-devlake/issues/6510#issuecomment-1824929156
Seems this has been introduced in this PR: https://github.com/apache/incubator-devlake/commit/e828cadb33ea7afc36a75b27ffb56331dafe6b46#diff-2a340770868d07c1add17eef1b9940aec95b7ba493925bf97a81a13592c6155dR113-R115
so @abeizn you may be the best person suited to propose a fix here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Github Plugin] Panic during github_graphql task, specifically when grabbing deployments [incubator-devlake]
Posted by "Bruno-DaSilva (via GitHub)" <gi...@apache.org>.
Bruno-DaSilva commented on issue #6510:
URL: https://github.com/apache/incubator-devlake/issues/6510#issuecomment-1824930392
Based on the graphql library, i think it may be because `variables` is nil and probably needs to be an empty map instead?
https://github.com/merico-dev/graphql/blob/77460a1fd4cdbf5a0716e01fc00eda4fe50871a3/query.go#L103-L107
which calls
https://github.com/merico-dev/graphql/blob/77460a1fd4cdbf5a0716e01fc00eda4fe50871a3/query.go#L111-L112
and so it's doing a `nil.Kind()`, I believe.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Github Plugin] Panic during github_graphql task, specifically when grabbing deployments [incubator-devlake]
Posted by "d4x1 (via GitHub)" <gi...@apache.org>.
d4x1 closed issue #6510: [Bug][Github Plugin] Panic during github_graphql task, specifically when grabbing deployments
URL: https://github.com/apache/incubator-devlake/issues/6510
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Github Plugin] Panic during github_graphql task, specifically when grabbing deployments [incubator-devlake]
Posted by "Bruno-DaSilva (via GitHub)" <gi...@apache.org>.
Bruno-DaSilva commented on issue #6510:
URL: https://github.com/apache/incubator-devlake/issues/6510#issuecomment-1825549101
thanks for the quick fix @abeizn !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org