Page MenuHomePhabricator

[builds-cli,builds-api] `build quota` fails if tool has no builds
Open, Stalled, MediumPublicBUG REPORT

Description

If a tool has no builds (and thus no harbor namespace), toolforge build quota fails with:

tools.taavi-test-tool@tools-sgebastion-11:~$ toolforge build quota
BuildClientError: Error getting quota from Harbor: failed to get harbor quota, status code: 403
Please report this issue to the Toolforge admins if it persists: https://w.wiki/6Zuu

builds-api logs aren't very helpful, but harbor logs do have this:

2023-12-19T13:46:08Z [ERROR] [/server/v2.0/handler/base.go:87]: failed to get project tool-taavi-test-tool: project tool-taavi-test-tool not found
2023-12-19T13:46:08Z [WARNING] [/common/rbac/project/evaluator.go:80]: Failed to get info of project 0 for permission evaluator, error: project 0 not found

Details

TitleReferenceAuthorSource BranchDest Branch
quota: show an error if project does not exist yetrepos/cloud/toolforge/builds-api!77sstefanovaslavina/fix-quotamain
Customize query in GitLab

Event Timeline

taavi updated the task description. (Show Details)
taavi changed the subtype of this task from "Task" to "Bug Report".
Slst2020 changed the task status from Open to In Progress.Jan 4 2024, 9:58 AM
Slst2020 moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 02) board.
Slst2020 changed the task status from In Progress to Open.Jan 9 2024, 2:47 PM
Slst2020 moved this task from In Progress to Next Up on the Toolforge (Toolforge iteration 02) board.
Slst2020 changed the task status from Open to In Progress.Jan 25 2024, 1:41 PM
Slst2020 moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 04) board.
dcaro triaged this task as Medium priority.Feb 7 2024, 10:12 AM

@Slst2020 this does not seem resolved to me? I can still reproduce the issue and there are no patches attached to this task.

@Slst2020 this does not seem resolved to me? I can still reproduce the issue and there are no patches attached to this task.

I forgot linking the Phab ticket in the MR. That's fixed now.

tools.nodejs-flask-buildpack-sample@tools-sgebastion-10:~$ toolforge build quota
BuildClientError: Error getting quota from Harbor: Quota cannot be displayed because no builds have run yet
Please report this issue to the Toolforge admins if it persists: https://w.wiki/6Zuu

This is temporary fix improving the error message; when the upstream harbor robot account permissions are fixed, we can display the quota as unused. Right now, we can't retrieve the default project quota because neither the maintain-harbor user nor the robot accounts have the necessary permissions.

Ok, then this task should be stalled and have the robot account permissions task added as a subtask, instead of being marked as Resolved.

dcaro renamed this task from `build quota` fails if tool has no builds to [builds-cli,builds-api] `build quota` fails if tool has no builds.Mar 5 2024, 3:57 PM
Slst2020 changed the task status from Stalled to Open.Wed, Apr 3, 12:03 PM
dcaro changed the task status from Open to Stalled.Tue, Apr 16, 2:09 PM
dcaro moved this task from Next Up to Blocked/Paused on the Toolforge (Toolforge iteration 08) board.