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 351 forks source link

An unknown error occurred on pipelines list if forge is unavailable #3942

Closed zc-devs closed 1 month ago

zc-devs commented 1 month ago

Component

server

Describe the bug

When forge is unavailable get An unknown error occurred on repository Activity tab. Woodpecker tries to load branches also and fails with 500.

Steps to reproduce

  1. Run Forge
  2. Run Woodpecker server
  3. Login into WP, go to the repositories list
  4. Turn off Forge / scale down to 0 / disallow WP-Forge connection via firewall
  5. Pick up some repo and open it
  6. See pipelines list and unknown error Activity tab - unknown error

Expected behavior

There should not be error on Activity tab. And not 500 on Branches tab.

System Info

`2.7.0`, Gitea

Additional context

No response

Validations

qwerty287 commented 1 month ago

The activity tries to load the branches too and fails because the forge is not reachable.

Actually it's not the activity tab but the manual pipeline popup where you can select the branches. What do you suggest to do instead?

zc-devs commented 1 month ago

it's not the activity tab

So I wrote.

but the manual pipeline popup where you can select the branches

Seems, you are right. I thought, it was Branches tab. Like in Settings.

What do you suggest to do instead?

  1. Call methods on demand. If I didnt call Run pipeline button, then I do not need branches, right? If I'm on General settings tab, I do not need other tabs information. I've seen an issue/discussion about that recently, though.
  2. Rewording an error would be great. Something like cannot load branches because forge is unavailable.
qwerty287 commented 1 month ago

I thought, it was Branches tab.

Yes, sometimes all tabs are loaded at once, but not always. See #3827

zc-devs commented 1 month ago

See https://github.com/woodpecker-ci/woodpecker/issues/3827

That is that I meant. Thanks for linking.

I've just checked, seems, Run pipeline make separate call to branches. Run pipeline

qwerty287 commented 1 month ago

Hm weird I didn't check that much there but it was my assumption that the popup is the problem… But yes, it should only be loaded on opening

zc-devs commented 1 month ago

Also, there are (always?) two requests for branches: one with page=1 and second with page=2. For example, I open Branches tab. I see loading spinner and request with page=1. Right after branches are loaded, I see second request with page=2 in the browser console. Two branches requests As you can see I have only two branches, so second response is empty.

qwerty287 commented 1 month ago

Ah yes, that's something on my refactoring list too… Should be easy though, I can try to take a look in a few minutes…