samcrang opened a new issue, #4772:
URL: https://github.com/apache/incubator-devlake/issues/4772

   ### 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
   
   We have an internal release tool which I've written a plugin to scrape 
releases from. We're using the new `pydevlake` plugin stuff.
   
   I've obfuscated some of the logs because the details aren't relevant to 
outside of where I work so I hope I've not removed anything useful.
   
   When trigger a run of a blueprint (`curl -v -X 'POST' 
'http://localhost:8080/blueprints/1/trigger'`) we end up with a `panic`:
   
   ```
   ...
   time="2023-03-24 15:01:22" level=info msg=" [pipeline service] [pipeline #1] 
[task #1] [collectHopperReleases] DEBUG: https://***.net:443 "GET 
/api/apps/test-http/releases?page=13 HTTP/1.1" 200 None"
   time="2023-03-24 15:01:22" level=info msg=" [pipeline service] [pipeline #1] 
[task #1] [collectHopperReleases] DEBUG: https://***.net:443 "GET 
/api/apps/test-http/releases?page=15 HTTP/1.1" 200 None"
   time="2023-03-24 15:01:22" level=info msg=" [pipeline service] [pipeline #1] 
[task #1] [collectHopperReleases] DEBUG: https://***.net:443 "GET 
/api/apps/test-http/releases?page=17 HTTP/1.1" 200 None"
   time="2023-03-24 15:01:23" level=info msg=" [pipeline service] [pipeline #1] 
[task #1] [collectHopperReleases] DEBUG: https://***.net:443 "GET 
/api/apps/test-http/releases?page=19 HTTP/1.1" 200 None"
   time="2023-03-24 15:01:23" level=info msg=" [pipeline service] [pipeline #1] 
[task #1] [collectHopperReleases] DEBUG: https://***.net:443 "GET 
/api/apps/test-http/releases?page=21 HTTP/1.1" 200 None"
   panic: runtime error: invalid memory address or nil pointer dereference
   [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10082d0aa]
   
   goroutine 77 [running]:
   github.com/apache/incubator-devlake/core/utils.scanOutputPipe.func1()
           /Users/sam/src/incubator-devlake/backend/core/utils/ipc.go:246 +0xea
   created by github.com/apache/incubator-devlake/core/utils.StreamProcess
           /Users/sam/src/incubator-devlake/backend/core/utils/ipc.go:190 +0x34b
   exit status 2
   make[1]: *** [run] Error 1
   make: *** [dev] Error 2
   ```
   
   This works fine when run directly:
   
   ```
   poetry run hopper/main.py collect "{\"db_url\": 
\"mysql://deliveroo:[email protected]:3306/devlake\", \"scope\": {\"id\": 
\"test-http\", \"name\": \"test-http\"}, \"connection\": { \"id\": 1, \"name\": 
\"hopper\", \"endpoint\": \"https://***.net\";, \"token\": \"${TOKEN}\"}}" 
releases 3>&1
   DEBUG: Starting new HTTPS connection (1): hopper-sandbox.deliveroo.net:443
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=1 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=3 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=5 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=7 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=9 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=11 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=13 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=15 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=17 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=19 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=21 
HTTP/1.1" 200 None
   {"increment": 100, "current": 100}
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=23 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=23 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=23 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=25 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=27 
HTTP/1.1" 200 None
   DEBUG: https://***.net:443 "GET /api/apps/test-http/releases?page=29 
HTTP/1.1" 200 None
   ...
   ```
   
   I suspect what happens is [the message sent 
here](https://github.com/apache/incubator-devlake/blob/main/backend/python/pydevlake/pydevlake/subtasks.py#L68-L71)
 isn't correctly handled on the go side of the IPC.
   
   I've worked around this in the short term by setting `sync_point_interval` 
to something very large.
   
   ### What do you expect to happen
   
   It should not panic the blueprint should run successfully.
   
   ### How to reproduce
   
   See above.
   
   ### Anything else
   
   Every time.
   
   ### Version
   
   main
   
   ### 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