gitpod-io / gitpod

The developer platform for on-demand cloud development environments to create software faster and more securely.
https://www.gitpod.io
GNU Affero General Public License v3.0
12.81k stars 1.23k forks source link

Some prebuilds are not properly linked to their project #7689

Open gtsiolis opened 2 years ago

gtsiolis commented 2 years ago

Bug description

Some incremental prebuilds link back to an non-existent (unknown) base prebuild.

For example:

See relevant discussion (internal). Cc @jankeromnes

Incremental Prebuild Base Prebuild
Screenshot 2022-01-19 at 4 50 21 PM (2) Screenshot 2022-01-19 at 4 50 25 PM (2)

Steps to reproduce

N/A

Workspace affected

No response

Expected behavior

No response

Example repository

No response

Anything else?

No response

jankeromnes commented 2 years ago

Re-posting from Slack:

the base prebuild a39f6aa4-3c6d-4447-9e44-40411b38152b actually exists in the DB, but it's not associated to a Project 🤔

{
  "id": "a39f6aa4-3c6d-4447-9e44-40411b38152b",
  "cloneUrl": "https://github.com/gitpod-io/gitpod.git",
  "commit": "ddd3ced7bf335267d0553d8ea570dc6ed7b9fc63",
  "state": "available",
  "creationTime": "2022-01-17 06:20:29.782139 UTC",
  "projectId": "",
  "branch": ""
}

The missing Project association why it doesn't show up in the UI. However, I don't know why it didn't get associated (especially since the Prebuild is recent -- from 2 days ago) 🐛

jankeromnes commented 2 years ago

Found this relevant log entry:

2022-01-17T06:20:47.504446Z Query INSERT IGNORE INTO d_b_prebuilt_workspace (id, cloneURL, commit, state, creationTime, buildWorkspaceId, snapshot, error, _lastModified, projectId, branch) VALUES ('a39f6aa4-3c6d-4447-9e44-40411b38152b', 'https://github.com/gitpod-io/gitpod.git', 'ddd3ced7bf335267d0553d8ea570dc6ed7b9fc63', 'building', '2022-01-17 06:20:29.782139', 'gitpodio-gitpod-s0q6z0qt15o', '', '', '2022-01-17 06:20:31.996503', '', '');

This is creating the prebuild with state building and both projectId and branch set to ''.

There are several updates after that to change the state, and every time projectId and branch are also ''.

jankeromnes commented 2 years ago

Changed issue title to "Some prebuilds are not properly linked to their project" because that's the root problem (the unknown base prebuild exists, but it's just not associated with the project, thus it doesn't show up in the UI)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

david-bakin commented 2 years ago

For anyone who finds this after the forced change to require a Team for access to the prebuilds page of the dashboard: You might get this "unknown prebuild" error on an initial prebuild after the conversion. Fix is apparently to check in some kind of commit (anything trivial will do, like a harmless whitespace change somewhere). That has (in at least one instance) kicked out a new prebuild properly attached to its project. (See discord discussion for example.)