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

[PVC] unable to open the workspace with download initializer #13531

Closed
Tracked by #7901
jenting opened this issue Oct 3, 2022 · 4 comments · Fixed by #13552
Closed
Tracked by #7901

[PVC] unable to open the workspace with download initializer #13531

jenting opened this issue Oct 3, 2022 · 4 comments · Fixed by #13552
Assignees
Labels
team: workspace Issue belongs to the Workspace team type: bug Something isn't working

Comments

@jenting
Copy link
Contributor

jenting commented Oct 3, 2022

Bug description

function GetContentLayerPVC returns no backup or valid initializer present when the StartWorkspace request with the download initializer.

if fullWorkspaceBackupEnabled || pvcFeatureEnabled {
owner := pod.Labels[wsk8s.OwnerLabel]
workspaceID := pod.Labels[wsk8s.MetaIDLabel]
initializerRaw, ok := pod.Annotations[workspaceInitializerAnnotation]
if !ok {
return nil, xerrors.Errorf("pod %s has no %s annotation", pod.Name, workspaceInitializerAnnotation)
}
initializerPB, err := base64.StdEncoding.DecodeString(initializerRaw)
if err != nil {
return nil, xerrors.Errorf("cannot decode init config: %w", err)
}
var initializer csapi.WorkspaceInitializer
err = proto.Unmarshal(initializerPB, &initializer)
if err != nil {
return nil, xerrors.Errorf("cannot unmarshal init config: %w", err)
}
var cl []layer.Layer
if pvcFeatureEnabled {
cl, _, err = m.Content.GetContentLayerPVC(ctx, owner, workspaceID, &initializer)
} else {
cl, _, err = m.Content.GetContentLayer(ctx, owner, workspaceID, &initializer)
}
if err != nil {
return nil, xerrors.Errorf("cannot get content layer: %w", err)
}
contentLayer := make([]*regapi.ContentLayer, len(cl))
for i, l := range cl {
if len(l.Content) > 0 {
contentLayer[i] = &regapi.ContentLayer{
Spec: &regapi.ContentLayer_Direct{
Direct: &regapi.DirectContentLayer{
Content: l.Content,
},
},
}
continue
}
diffID := l.DiffID
contentLayer[i] = &regapi.ContentLayer{
Spec: &regapi.ContentLayer_Remote{
Remote: &regapi.RemoteContentLayer{
DiffId: diffID,
Digest: l.Digest,
MediaType: string(l.MediaType),
Url: l.URL,
Size: l.Size,
},
},
}
}
spec.ContentLayer = contentLayer
}
return &regapi.GetImageSpecResponse{
Spec: spec,
}, nil

Steps to reproduce

Set the persistent_volume_claim feature for your user

Open the workspace from the repo https://github.com/utam0k/utam0k.github.io

https://gitpod.slack.com/archives/C02F19UUW6S/p1664770050148509

Workspace affected

No response

Expected behavior

It should open the workspace.

Example repository

https://github.com/utam0k/utam0k.github.io

Anything else?

#7901

@jenting jenting added type: bug Something isn't working team: workspace Issue belongs to the Workspace team labels Oct 3, 2022
@jenting
Copy link
Contributor Author

jenting commented Oct 3, 2022

cc @sagor999

@jenting
Copy link
Contributor Author

jenting commented Oct 5, 2022

Since the code of PVC is similar to FWB.
So I enabled the FWB and opened the https://github.com/utam0k/utam0k.github.io, and it failed with the same error message.
image

@sagor999
Copy link
Contributor

sagor999 commented Oct 5, 2022

@jenting do not use FWB. that code has not been tested in a very long time.

@jenting
Copy link
Contributor Author

jenting commented Oct 5, 2022

@jenting do not use FWB. that code has not been tested in a very long time.

I want to ensure the FWB would hit the same error because the code is similar.

Repository owner moved this from In Progress to Awaiting Deployment in 🌌 Workspace Team Oct 6, 2022
@jenting jenting moved this from Awaiting Deployment to In Validation in 🌌 Workspace Team Oct 13, 2022
@sagor999 sagor999 moved this from In Validation to Done in 🌌 Workspace Team Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: workspace Issue belongs to the Workspace team type: bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants