Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on login screen. #3689

Open
3 tasks done
SzateX opened this issue May 7, 2024 · 12 comments
Open
3 tasks done

Stuck on login screen. #3689

SzateX opened this issue May 7, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@SzateX
Copy link

SzateX commented May 7, 2024

Component

server, web-ui

Describe the bug

Hi, I have problem with my woodpecker instance. I'm using Github to provide OAuth2 Authorization. But the problem I cannot log in to the app. When I clicking "Log in" button, it returns to the same screen. Sometimes when I do many clicks in small amount time I need reatuhorize it in Github.

Instance is hidden with ngnix proxy manager.

My docker compose looks like this:

services:
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:latest
    expose:
      - 8000
      - 9000
    volumes:
      - ./woodpecker-server-data:/var/lib/woodpecker/
    environment:
      - WOODPECKER_OPEN=false
      - WOODPECKER_HOST=${WOODPECKER_HOST}
      - WOODPECKER_GITHUB=true
      - WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
      - WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
      - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
      - WOODPECKER_ADMIN=${WOODPECKER_ADMIN}
      - WOODPECKER_REPO_OWNERS=${WOODPECKER_REPO_OWNERS}
    networks:
      - ngnix-internal
      - composehook-internal
  woodpecker-agent:
    image: woodpeckerci/woodpecker-agent:latest
    command: agent
    restart: always
    depends_on:
      - woodpecker-server
    volumes:
      - ./woodpecker-agent-config:/etc/woodpecker
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WOODPECKER_SERVER=woodpecker-server:9000
      - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
      - WOODPECKER_BACKEND_DOCKER_NETWORK=composehook-internal
    networks:
      - ngnix-internal
      - composehook-internal
networks:
  ngnix-internal:
    external: true
    name: ngnix-internal
  composehook-internal:
    external: true
    name: composehook-internal

In logs I haven't see something weird or wrong.

System Info

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

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
@SzateX SzateX added the bug Something isn't working label May 7, 2024
@qwerty287
Copy link
Contributor

If the authorization fails, you are not directly redirected back to the login screen, but first to an error (unfortunately, this error is not shown yet - #3380). Can you try to use the network analysis of your browser to get the URL you are redirected to and then check the error? The URL has an error query param.

Otherwise, this looks like your host URLs are configured wrong. Can you double-check:

  • the redirection URL registered in the github oauth app
  • the WOODPECKER_HOST variable

@theweekendgeek
Copy link

I see that you have - WOODPECKER_OPEN=false in your compose file. I had the same issue and it was because of that.

@SzateX
Copy link
Author

SzateX commented May 12, 2024

It's something weird happen - because I wanted to grab the network logs for you. But suddenly It worked and signed me and every try of log out and log in works, without chaning any settings

@qwerty287
Copy link
Contributor

So we can close this?

@SzateX
Copy link
Author

SzateX commented May 13, 2024

I don't think so. I will try to achive the issue again.

@shanduur
Copy link

I have the same issue. Kubernetes, Woodpecker 2.4.1. Cannot login until I restart the pod, sometimes even that do not work. If I am already logged in, everything is SLOW, and I cannot manually trigger jobs, as the pop-up is not loading. Tested on Safari and Firefox. Debug log shows nothing suspicious.

I think that adding request tracing might be a good option to better understand issues like this.

@shanduur
Copy link

UI sometimes throws red box with "Unknown error occurred" message.

@qwerty287
Copy link
Contributor

I think that adding request tracing might be a good option to better understand issues like this.

Did you try trace log level? Then I think it shows the requests, but not sure which information is logged.

@shanduur
Copy link

@qwerty287 I meant distributed tracing (using e.g. OpenTelemetry SDK)

@shanduur
Copy link

This one is pretty strange:

{"level":"debug","ip":"x.x.x.x","latency":12022.245185,"method":"GET","path":"/api/repos/1","status":200,"time":"2024-05-18T18:07:20Z","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15","time":"2024-05-18T18:07:20Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:59"}

@gamingdy
Copy link

I have the same issue but with gitea, I have the following compose file

services:
    woodpecker-server:
        container_name: woodpecker_server
        image: woodpeckerci/woodpecker-server:latest
        restart: always
        volumes:
            - ./data/woodpecker-server-data:/var/lib/woodpecker/
        environment:
            - WOODPECKER_LOG_LEVEL=trace
            - WOODPECKER_OPEN=false
            - WOODPECKER_ADMIN=
            - WOODPECKER_GITEA=true
            - WOODPECKER_GITEA_URL=
            - WOODPECKER_GITEA_CLIENT=
            - WOODPECKER_GITEA_SECRET=
            - WOODPECKER_HOST=
            - WOODPECKER_AGENT_SECRET=
        networks:
            - woodpecker
            - proxy-net

    woodpecker-agent:
        image: woodpeckerci/woodpecker-agent:latest
        command: agent
        restart: always
        depends_on:
            - woodpecker-server
        volumes:
            - ./data/woodpecker-agent-config:/etc/woodpecker
            - /var/run/docker.sock:/var/run/docker.sock
        environment:
            - WOODPECKER_SERVER=woodpecker_server:9000
            - WOODPECKER_AGENT_SECRET=
        networks:
            - woodpecker

networks:
    woodpecker:
    proxy-net:
        name: proxy-network
        external: true

Log when I try to connect

woodpecker_server   | {"level":"trace","time":"2024-05-21T08:41:56Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:43","message":"[GET] /login"}
woodpecker_server   | {"level":"debug","ip":"","latency":0.531033,"method":"GET","path":"/login","status":303,"time":"2024-05-21T08:41:56Z","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","time":"2024-05-21T08:41:56Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:59"}
woodpecker_server   | {"level":"trace","time":"2024-05-21T08:41:56Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:43","message":"[GET] /authorize"}
woodpecker_server   | {"level":"debug","ip":"","latency":0.599918,"method":"GET","path":"/authorize","status":303,"time":"2024-05-21T08:41:56Z","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","time":"2024-05-21T08:41:56Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:59"}
woodpecker_server   | {"level":"trace","time":"2024-05-21T08:41:57Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:43","message":"[GET] /authorize?code=code&state=woodpecker"}
woodpecker_server   | {"level":"debug","time":"2024-05-21T08:41:57Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/login.go:204","message":"synced user permission for admin admin/test"}
woodpecker_server   | {"level":"debug","ip":"","latency":161.482788,"method":"GET","path":"/authorize","status":303,"time":"2024-05-21T08:41:57Z","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","time":"2024-05-21T08:41:57Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:59"}
woodpecker_server   | {"level":"trace","time":"2024-05-21T08:41:57Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:43","message":"[GET] /"}
woodpecker_server   | {"level":"debug","ip":"","latency":0.440463,"method":"GET","path":"/","status":200,"time":"2024-05-21T08:41:57Z","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","time":"2024-05-21T08:41:57Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:59"}
woodpecker_server   | {"level":"debug","time":"2024-05-21T08:41:57Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/stream.go:82","message":"user feed: connection closed"}
woodpecker_server   | {"level":"debug","ip":"","latency":346137.119936,"method":"GET","path":"/api/stream/events","status":200,"time":"2024-05-21T08:41:57Z","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","time":"2024-05-21T08:41:57Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:59"}
woodpecker_server   | {"level":"trace","time":"2024-05-21T08:41:58Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/router.go:43","message":"[GET] /api/stream/events"}
woodpecker_server   | {"level":"debug","time":"2024-05-21T08:41:58Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/stream.go:63","message":"user feed: connection opened"}

Woodpecker 2.4.1 amd64

@pat-s
Copy link
Contributor

pat-s commented May 21, 2024

I think this should be converted into a discussion and split up into individual issues. Different settings/envs are mixed in here which likely do not share the same underlying issue.

It is likely a config/user error (at least with 2.4.1) as this version is confirmed to be running fine with oauth in many instances (for quite some time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants