woodpecker-ci / woodpecker

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

Support for Gitlab <12.4 broken #3598

Closed NPCDW closed 1 month ago

NPCDW commented 3 months ago

Component

server

Describe the bug

image image image image

Do Woodpecker CI versions v2.4.0 and v2.4.1 drop support for lower versions of GitLab?

After clicking to add a repository, the page reports an error, but no error is logged in the logs.

This configuration operates perfectly in version v2.3.0. After upgrading to version v2.4.1, issues have emerged with functionalities related to adding repositories and other repository-related functions, whereas all other functionalities continue to operate normally.

After I reverted back to version v2.3.0, everything returned to normal again.

System Info

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

GitLab Community Edition 11.0.3 aa62075 Docker version 24.0.6, build ed223bc Docker Compose version v2.21.0

services:
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:v2.4.1
    container_name: woodpecker-server
    ports:
      - 55555:8000
      - 55559:9000
    volumes:
      - ./data:/var/lib/woodpecker/
    environment:
      - TZ=Asia/Shanghai
      - WOODPECKER_HOST=http://10.10.10.2:55555
      - WOODPECKER_ADMIN=***,***
      - WOODPECKER_GITLAB=true
      - WOODPECKER_GITLAB_URL=
      - WOODPECKER_GITLAB_CLIENT=
      - WOODPECKER_GITLAB_SECRET=
      - WOODPECKER_AGENT_SECRET=
      - WOODPECKER_AUTHENTICATE_PUBLIC_REPOS=true
      - WOODPECKER_LOG_LEVEL=trace

Additional context

No response

Validations

qwerty287 commented 3 months ago

Do Woodpecker CI versions v2.4.0 and v2.4.1 drop support for lower versions of GitLab?

No.

Can you check the browser console and the response of the request made by the web interface?

NPCDW commented 3 months ago

The console error messages are as follows, with the top two also present in the normal version, while the network request error is newly added. image The network request is as follows: After clicking the ‘Add Repository’ button, only this particular request is abnormal, while all other requests return normally. image

qwerty287 commented 3 months ago

Are you sure your gitlab base URL is configured correctly? There's a not found error and it in your first screenshot in the issue description above it looks like the profile avatar also fails to load.

EDIT: If it's working in 2.3.0 that can't really be the problem. Can you check the gitlab logs? Can you see the 404 request there?

NPCDW commented 3 months ago

I am absolutely certain that there is no issue with the base URL configuration of GitLab. The avatar failed to load because this particular user has not set an avatar in GitLab. Other users are able to load their avatars without any problem.

Moreover, I upgraded directly from v2.3.0, having modified only the version number in the docker-compose.yml file without altering any other configurations.

image image

qwerty287 commented 3 months ago

Can you check the gitlab logs? Can you see the 404 request there? Or can you try to find out the IDs of the projects that fail? In your screenshot above there is 4118

NPCDW commented 3 months ago

I roughly understand what’s going on now. This URL was introduced in issue #3308 , but this URL is only usable in GitLab 12.4.

image

image

qwerty287 commented 3 months ago

I see… cc @lukashass any ideas how to solve this?

qwerty287 commented 1 month ago

Looking at this again, we can probably just remove support for these old gitlab versions. 12.4 was released almost 5 years ago.

NPCDW commented 1 month ago

OK, just note in the document that <=2.3.0 supports 8+, >=2.4.0 supports 12.5+