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/[email protected]/query.go:112
 +0x61
   github.com/merico-dev/graphql.query({0x0, 0x0}, 0x227?)
        
/go/pkg/mod/github.com/merico-dev/[email protected]/query.go:105
 +0x7f
   github.com/merico-dev/graphql.ConstructQuery({0x0?, 0x0?}, 0x0)
        
/go/pkg/mod/github.com/merico-dev/[email protected]/query.go:16
 +0x46
   github.com/merico-dev/graphql.(*Client).Query(0xc0014c9728?, {0x1ab4248, 
0xc0015ed630}, {0x0, 0x0}, 0x0?)
        
/go/pkg/mod/github.com/merico-dev/[email protected]/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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to