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

Can't Log into Woodpecker #519

Closed
xSTUDDSx opened this issue Nov 19, 2021 · 17 comments
Closed

Can't Log into Woodpecker #519

xSTUDDSx opened this issue Nov 19, 2021 · 17 comments
Labels
bug Something isn't working

Comments

@xSTUDDSx
Copy link

xSTUDDSx commented Nov 19, 2021

I have Woodpecker setup with Gitea and have established the Client and Secret. When I click login on Woodpecker, I get directed to Gitea and I login, however, after Authorizing I get dumped back to Woodpecker's main login page with this URL...

I can't seem to get into Woodpecker at all. There are no errors in the logs of the server, but I do see this error in the log of the agent.

{"level":"error","error":"rpc error: code = Unavailable desc = connection closed before server preface received","time":"2021-11-19T14:47:03Z","message":"grpc error: done(): code: Unavailable: rpc error: code = Unavailable desc = connection closed before server preface received"}

Here is my docker-compose...

version: '3'

networks:
  reverse-proxy:
    external:
      name: reverse-proxy

services:
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:latest
    container_name: woodpecker-server
    networks:
      - reverse-proxy
    ports:
      - 8000:8000
    volumes:
      - woodpecker-server-data:/var/lib/woodpecker/
    environment:
      - WOODPECKER_OPEN=true
      - WOODPECKER_HOST=https://woodpecker.mydomain.com
      - WOODPECKER_GITEA=true
      - WOODPECKER_GITEA_URL=https://gitea.mydomain.com
      - WOODPECKER_GITEA_CLIENT=<GITEA_CLIENT>
      - WOODPECKER_GITEA_SECRET=<GITEA_SECRET>
      - WOODPECKER_AGENT_SECRET=<AGENT_SECRET>

  woodpecker-agent:
    image: woodpeckerci/woodpecker-agent:latest
    container_name: woodpecker-agent
    command: agent
    restart: always
    depends_on:
      - woodpecker-server
    networks:
      - reverse-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WOODPECKER_SERVER=woodpecker-server:8000
      - WOODPECKER_AGENT_SECRET=<AGENT_SECRET>

volumes:
  woodpecker-server-data:
@f97-2308
Copy link

Same me, anyone have solution? 😢

@corgijan
Copy link

@f97 @xSTUDDSx Have you set up oAuth with /authorize?
Ive written a little blog how to set it up with github ....maybe it helps: https://www.corgis.ml/woodpecker

@6543
Copy link
Member

6543 commented Nov 26, 2021

@xSTUDDSx the agent does conect via gRPC so you need port :9000

@xSTUDDSx
Copy link
Author

@Iamjava Yes I have setup the OAuth using this guide since I'm using gitea.

@6543 I originally had 9000, but it wasn't working so I changed it to 8000 thinking the documentation here had a typo.

Either way, I re-verified the OAuth setup and also tried both ports 8000 and 9000 mentioned on the WOODPECKER_SERVER variable and I still end up with the same result.

@anbraten
Copy link
Member

anbraten commented Nov 30, 2021

Woodpecker uses two ports. Port 8000 is used for the web-UI and port 9000 for the agent communication via grpc.

@anbraten
Copy link
Member

Agent logs / errors should be independent from your login problems.

Could you verify the callback address you inserted into Gitea, please. It should be in the form of: https://your-woodpecker.tld/authorize

@xSTUDDSx
Copy link
Author

xSTUDDSx commented Dec 1, 2021

Yes, verified that it has my domain with /authorize at the end.

Gitea_Woodpecker_OAuth

@xSTUDDSx
Copy link
Author

xSTUDDSx commented Dec 7, 2021

For a little more information, out of curiosity I attempted to setup Drone to see if I was also experiencing the same issue with that app. However, I had zero issues setting it up. I am able to use OAuth in Gitea to authorize the Drone app and successfully log in where I can then see Drone is pulling the repo information from my Gitea server.

Therefore, this seems to be an issue with Woodpecker after the fork and not something carried over from Drone. Either that or if it was in Drone, they have fixed it post-fork.

@6543
Copy link
Member

6543 commented Dec 7, 2021

Thanks for your tests, ... I'm kind a confused how i'm able to reproduce the issue :/

I'll give it a try today again...lets see

@xSTUDDSx
Copy link
Author

xSTUDDSx commented Dec 7, 2021

@6543 So I've figured out the issue is with the reverse proxy. If I get rid of my reverse-proxy network and use just the IP:Port instead of my public domain for Woodpecker, then it works.

I think #176 will fix this once it gets merged.

@6543
Copy link
Member

6543 commented Dec 7, 2021

Ah thats a good hint!

@6543 6543 added the bug Something isn't working label Dec 7, 2021
@anbraten
Copy link
Member

anbraten commented Dec 7, 2021

Could you provide some context about your reverse proxy setup. In general it should work without problems behind a reverse-proxy. The official woodpecker instance of this project for example is using Caddy in a reverse-proxy setup. Caddyfile, our docker-compose config.

@xSTUDDSx
Copy link
Author

xSTUDDSx commented Dec 8, 2021

@anbraten I'm using nginx proxy manager. I'm not familiar with Caddy, but looking at your compose compared to mine in the original post it looks pretty much the same in regards to handling the network.

@f97-2308
Copy link

f97-2308 commented Dec 9, 2021

@6543 I was back to droneio and drone works okay so I think it's a bug by woodpecker.

@6543
Copy link
Member

6543 commented Dec 9, 2021

It's sad to hear, but what works best for you ...

PS: I cant reproduce it atm - but I'll let this issue open to see if we can hunt it down at some point

@6543
Copy link
Member

6543 commented Dec 20, 2021

ok it looks like "nginx proxy manager" and woodpecker do not like to work together, can you test if it works whit caddy or plain nginx?

@anbraten
Copy link
Member

Seems to be related to the specific setup in this case. So closing for now as I don't see a way Woodpecker could be adjusted here.

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

5 participants