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

Github repository list empty #1582

Closed
4 tasks done
dessalines opened this issue Feb 9, 2023 · 12 comments · Fixed by #1603
Closed
4 tasks done

Github repository list empty #1582

dessalines opened this issue Feb 9, 2023 · 12 comments · Fixed by #1603
Labels
bug Something isn't working feedback this needs feedback

Comments

@dessalines
Copy link
Contributor

Component

server

Describe the bug

I'm trying to set up woodpecker. I finally got oauth working, and logged in with my personal user.

The repo list shows as empty.

I click Add Repository, then Reload repositories, and after 10 seconds, it says Repository list loaded... yet the list is still empty.

I've tried changing many of the vars below, all with no luck.

The oauth is most likely working fine, so I don't know why it can't load my repo list.

environment:
  - WOODPECKER_OPEN=true
  - WOODPECKER_HOST=https://drone.join-lemmy.org
  - WOODPECKER_LOG_LEVEL=info
  - WOODPECKER_AGENT_SECRET=${DRONE_RPC_SECRET}
  - WOODPECKER_GITHUB=true
  - WOODPECKER_GITHUB_CLIENT=${CLIENT_ID}
  - WOODPECKER_GITHUB_SECRET=${SECRET}
  - WOODPECKER_ADMIN=dessalines
  - WOODPECKER_REPO_OWNERS=dessalines

System Info

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

Additional context

No response

Validations

@dessalines
Copy link
Contributor Author

dessalines commented Feb 9, 2023

I did a completely from-scratch install, with a new domain, and new oauth, and I can confirm this is an issue.

Edit: I've also verified that the gitea integration is working correctly, the repos do get synced.

@dessalines
Copy link
Contributor Author

Any updates on this? We'd really like to switch from drone to woodpecker for Lemmy, but this is a blocker.

@6543
Copy link
Member

6543 commented Feb 15, 2023

hmm it could be that github do limit the api requests ...

@6543
Copy link
Member

6543 commented Feb 15, 2023

@dessalines you could try WOODPECKER_FLAT_PERMISSIONS=true

read more at #625

@6543 6543 added the feedback this needs feedback label Feb 15, 2023
@dessalines
Copy link
Contributor Author

dessalines commented Feb 16, 2023

Tried both that, and false, still empty.

It has a green popup that says repository list empty, and the logs contain nothing.

@dessalines
Copy link
Contributor Author

Any other possible solutions? We'd really like to switch to woodpecker for lemmy.

@anbraten
Copy link
Member

@dessalines Could you try the next version of Woodpecker?

@dessalines
Copy link
Contributor Author

dessalines commented Feb 27, 2023

@anbraten

Broken on both 0.15.6 and next.

It says "Repository list loaded" in a green toast, yet nothing is loaded.

Edit: Sorry, the logs I posted before were from the agent, not the server. The server has nothing in its logs.

@anbraten anbraten added bug Something isn't working and removed pending:bug labels Feb 28, 2023
@anticitizn
Copy link

Same results here, neither 0.15.6 nor next can load the list of repos on a seemingly correctly configured installation

@hay-kot
Copy link
Contributor

hay-kot commented Mar 4, 2023

I'm also having the same issue. It's easily replicated in development by creating a new token w/ a new database. The Sync repositories all works fine with the WOODPECKER_FLAT_PERMISSIONS=true workaround and everything is saved in the database. However, no results are returned via the API because of this query

https://github.com/hay-kot/woodpecker/blob/15a50bc0a3ca7346e96a46948c2122bd8b2f9a36/server/store/datastore/repo.go#L148-L150

if owned {
    sess = sess.And(builder.Eq{"perms.perm_push": true}.Or(builder.Eq{"perms.perm_admin": true}))
}

If you use the work around perm_push and perm_admin are both always false

Pretty sure it's just a logical issue here:

https://github.com/hay-kot/woodpecker/blob/15a50bc0a3ca7346e96a46948c2122bd8b2f9a36/server/forge/userSyncer.go#L81

repo.Perm will never be null because it's assigned directly above.

This PR will fix the issue, but I'm not sure if that's the expected behavior?

6543 pushed a commit that referenced this issue Mar 14, 2023
Closes #1582 

When `WOODPECKER_FLAT_PERMISSIONS=true` workaround is applied all
permissions are set to false (default) and query never returns any
matches.

This fixes it by always assigning Pull/Push/Admin to true when flatPermissions is enabled.
@dessalines
Copy link
Contributor Author

It worked on next, thanks!

@bergpb
Copy link

bergpb commented Apr 18, 2023

I run into the same problem here, and with the next version I was able to list all the repositories, but when I click Enable, it only shows an unauthorized error.
I don't find any related logs in woodpecker server container.

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

Successfully merging a pull request may close this issue.

6 participants