woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.07k stars 353 forks source link

CLI repo add: invalid character '<' looking for beginning of value #2088

Closed runephilosof-karnovgroup closed 1 year ago

runephilosof-karnovgroup commented 1 year ago

Component

cli

Describe the bug

user@fedora:~ $ docker run -e WOODPECKER_SERVER -e WOODPECKER_TOKEN woodpeckerci/woodpecker-cli:latest-alpine -- repo add 528940444
8:08AM FTL error running cli error="invalid character '<' looking for beginning of value"

System Info

Server
{"source":"https://github.com/woodpecker-ci/woodpecker","version":"1.0.0"}

Client
REPOSITORY                    TAG             IMAGE ID       CREATED      SIZE
woodpeckerci/woodpecker-cli   latest-alpine   0eb7866dd2b9   3 days ago   48.9MB

Additional context

No response

Validations

runephilosof-karnovgroup commented 1 year ago

Maybe the request the go client library is making is wrong. It is different from what the javascript UI is making.

Debug log from the server showing the two different requests

2023-08-02 10:08:27.000 CEST
{ip: 10.100.32.116, latency: 3.976252, level: debug, method: POST, path: /api/repos/528940444, status: 200, user-agent: Go-http-client/1.1}
2023-08-02 10:17:47.000 CEST
{ip: 10.100.32.116, latency: 1671.072989, level: debug, method: POST, path: /api/repos, status: 200, user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36}
runephilosof-karnovgroup commented 1 year ago

The UI is sending a POST request to https://woodpecker-host/api/repos?forge_remote_id=528940444