Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Regression: go 1.17 feature breaks ubuntu focal images now that 1.17.7 released #1300

Closed
awmcclain opened this issue Feb 9, 2022 · 19 comments · Fixed by #1302
Closed

Regression: go 1.17 feature breaks ubuntu focal images now that 1.17.7 released #1300

awmcclain opened this issue Feb 9, 2022 · 19 comments · Fixed by #1302
Labels
bug Issue identified by VS Code Team member as probable bug go upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@awmcclain
Copy link

  • Local chip architecture: amd64
  • Reproduces in: Codespaces
  • Name of Dev Container Definition with Issue: ubuntu 20.04

Apparently the go version got bumped this morning -- selecting go as a feature causes new images/rebuilds to fail.

creation log:

[2022-02-09T18:46:15.309Z] #6 70.36 GO_GPG_KEY_URI=https://dl.google.com/linux/linux_signing_key.pub
2022-02-09T18:46:18: #6 70.42 Downloading Go 1.17.7...
[2022-02-09T18:46:16.361Z] #6 71.36 gpg: no valid OpenPGP data found.
2022-02-09T18:46:18: #6 71.36 gpg: the signature could not be verified.
2022-02-09T18:46:18: #6 71.36 Please remember that the signature file (.sig or .asc)
2022-02-09T18:46:18: #6 71.36 should be the first file given on the command line.
[2022-02-09T18:46:18.016Z] #6 ERROR: executor failed running [/bin/sh -c cd /tmp/build-features/local-cache && chmod +x ./install.sh && ./install.sh]: exit code: 2
2

devcontainer.json


	"name": "Ubuntu",
	"build": {
		"dockerfile": "Dockerfile",
		// Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic
		// Use hirsute or bionic on local arm64/Apple Silicon.
		"args": { "VARIANT": "focal" }
	},

	// Set *default* container specific settings.json values on container create.
	"settings": {},


	// Add the IDs of extensions you want installed when the container is created.
	"extensions": [],

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],

	// Use 'postCreateCommand' to run commands after the container is created.
	//"postCreateCommand": ".devcontainer/postcreate.sh",

	// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
	"remoteUser": "vscode",
	"features": 
		"golang": "1.17"
	}
}

Changing the golang version to 1.17.6 fixes.

@Chuxel Chuxel added upstream Issue identified as 'upstream' component related (exists outside of VS Code) go labels Feb 10, 2022
@Chuxel
Copy link
Member

Chuxel commented Feb 10, 2022

Interesting - it's clearly published, but binaries are not available yet: https://go.googlesource.com/go/+/refs/tags/go1.17.7

First time we've seen that - there must have been some sort of problem with the release. There seemed to be errors golang/go#51102

@Chuxel
Copy link
Member

Chuxel commented Feb 10, 2022

//cc @joshspicer This is another reason to consider using the GitHub Actions archived copies for these scripts. https://github.com/actions/go-versions We could also fall back in this situation and try the previous version we find.

@Chuxel Chuxel added the bug Issue identified by VS Code Team member as probable bug label Feb 10, 2022
@aidan-melen
Copy link

aidan-melen commented Feb 10, 2022

Same deal

 Step 35/71 : RUN /bin/bash /tmp/library-scripts/go-debian.sh "${GO_VERSION}" "${GOROOT}" "${GOPATH}"
 ---> Running in 435f360fd441
TARGET_GO_VERSION=1.17.7
Downloading Go 1.17.7...
Extracting Go 1.17.7...

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
The command '/bin/sh -c /bin/bash /tmp/library-scripts/go-debian.sh "${GO_VERSION}" "${GOROOT}" "${GOPATH}"' returned a non-zero code: 2

Error: Process completed with exit code 2.

or local

bash go-debian.sh                                                                                                                                                                                                                      main
TARGET_GO_VERSION=1.17.7
Downloading Go 1.17.7...
Extracting Go 1.17.7...

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

@joshspicer
Copy link
Member

joshspicer commented Feb 10, 2022

Yea @Chuxel - actually also just ran into this testing a new build of kitchensink :/

The features UX won't recommend break-fix versions, but editing your devcontainer.json to

	"features": {
		"golang": "1.17.6"
	}

should mitigate this for now while golang resolves this upstream 👍

@aidan-melen
Copy link

Yeah i am pinning to 1.17.6 for now. We probably shouldn't be using latest anyways. Asking for issues like this one

@woehrl01
Copy link

woehrl01 commented Feb 10, 2022

Pinning it to 1.17.6 using the go-debian.sh script causes the following error:
I am uncertain if this should be tracked in a separate issue.

> [linux/amd64 stage-3  6/19] RUN apt-get update && bash /tmp/library-scripts/go-debian.sh "1.17.6" "/usr/local/go" "/go" && apt-get clean -y:
#15 46.97 github.com/golangci/golangci-lint/pkg/result/processors
#15 47.12 github.com/golangci/golangci-lint/pkg/lint
#15 47.18 github.com/golangci/golangci-lint/pkg/commands
#15 47.32 github.com/golangci/golangci-lint/cmd/golangci-lint
#15 50.57 go: downloading github.com/go-delve/delve v1.8.2-0.20220210175055-dee4437bd088
#15 51.13 go install: github.com/go-delve/delve/cmd/dlv@master (in github.com/go-delve/[email protected]):
#15 51.13 	The go.mod file for the module providing named packages contains one or
#15 51.13 	more replace directives. It must not contain directives that would cause
#15 51.13 	it to be interpreted differently than if it were the main module.
#15 51.13 mv: cannot stat '/tmp/gotools/bin/dlv': No such file or directory
------
Dockerfile_Baseline:45
--------------------
  43 |       GOPATH=/go
  44 |     ENV PATH=${GOPATH}/bin:${GOROOT}/bin:${PATH}
  45 | >>> RUN apt-get update && bash /tmp/library-scripts/go-debian.sh "1.17.6" "${GOROOT}" "${GOPATH}" && apt-get clean -y
  46 |     
  47 |     #see: [microsoft/vscode-dev-containers@main/script-library/docs/sshd.md](https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/sshd.md)
--------------------
error: failed to solve: process "/bin/sh -c apt-get update && bash /tmp/library-scripts/go-debian.sh \"1.17.6\" \"${GOROOT}\" \"${GOPATH}\" && apt-get clean -y" did not complete successfully: exit code: 1

@aidan-melen
Copy link

aidan-melen commented Feb 10, 2022

Pinning it to 1.17.6 using the go-debian.sh script causes the following error: I am uncertain if this should be tracked in a separate issue.

> [linux/amd64 stage-3  6/19] RUN apt-get update && bash /tmp/library-scripts/go-debian.sh "1.17.6" "/usr/local/go" "/go" && apt-get clean -y:
#15 46.97 github.com/golangci/golangci-lint/pkg/result/processors
#15 47.12 github.com/golangci/golangci-lint/pkg/lint
#15 47.18 github.com/golangci/golangci-lint/pkg/commands
#15 47.32 github.com/golangci/golangci-lint/cmd/golangci-lint
#15 50.57 go: downloading github.com/go-delve/delve v1.8.2-0.20220210175055-dee4437bd088
#15 51.13 go install: github.com/go-delve/delve/cmd/dlv@master (in github.com/go-delve/[email protected]):
#15 51.13 	The go.mod file for the module providing named packages contains one or
#15 51.13 	more replace directives. It must not contain directives that would cause
#15 51.13 	it to be interpreted differently than if it were the main module.
#15 51.13 mv: cannot stat '/tmp/gotools/bin/dlv': No such file or directory
------
Dockerfile_Baseline:45
--------------------
  43 |       GOPATH=/go
  44 |     ENV PATH=${GOPATH}/bin:${GOROOT}/bin:${PATH}
  45 | >>> RUN apt-get update && bash /tmp/library-scripts/go-debian.sh "1.17.6" "${GOROOT}" "${GOPATH}" && apt-get clean -y
  46 |     
  47 |     #see: [microsoft/vscode-dev-containers@main/script-library/docs/sshd.md](https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/sshd.md)
--------------------
error: failed to solve: process "/bin/sh -c apt-get update && bash /tmp/library-scripts/go-debian.sh \"1.17.6\" \"${GOROOT}\" \"${GOPATH}\" && apt-get clean -y" did not complete successfully: exit code: 1

literally the same...

go install: github.com/go-delve/delve/cmd/dlv@master (in github.com/go-delve/[email protected]):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.
mv: cannot stat '/tmp/gotools/bin/dlv': No such file or directory
The command '/bin/sh -c /bin/bash /tmp/library-scripts/go-debian.sh "${GO_VERSION}" "${GOROOT}" "${GOPATH}"' returned a non-zero code: 1

@Chuxel
Copy link
Member

Chuxel commented Feb 10, 2022

That is unrelated. Updating to github.com/go-delve/delve/cmd/[email protected] in the script should fix it tactically. It looks like there was a break in the latest version that is causing a failure.

@Chuxel
Copy link
Member

Chuxel commented Feb 10, 2022

@hyangah - We're hitting a bit of a problem with a half-released version of go, but the other note here is that we've now we've now seen the github.com/go-delve/delve/cmd/dlv@master install fail a couple times with a break. Is that still needed with the latest version of the Go extension?

@Chuxel
Copy link
Member

Chuxel commented Feb 10, 2022

I just merged in a change into master that should handle the current situation. Keeping this open for a release to publish the updated script for use in dev container features.

//cc @chrmarti @joshspicer

@hyangah
Copy link
Contributor

hyangah commented Feb 10, 2022

@Chuxel The latest vscode-go extension no longer depends on dlv-dap (dlv@master) so, you can remove it from the script. Thanks for handling the issue.

@awmcclain
Copy link
Author

awmcclain commented Feb 13, 2022

What's the best way of getting the latest master to build the image? We're blocked on the dlv issue after trying to do another rebuild. Is this a vs-remote extension update or a codespaces extension update?

@hyangah
Copy link
Contributor

hyangah commented Feb 13, 2022

@awmcclain I think @Chuxel already resolved the dlv issue with #1304. dlv@latest is sufficient and dlv@master is no longer needed.

@awmcclain
Copy link
Author

awmcclain commented Feb 13, 2022 via email

@jmoody
Copy link

jmoody commented Feb 14, 2022

Good morning. This is blocking me as well. I updated the golang version to 1.17.6, but I see the same problem in my codespace.

@Chuxel
Copy link
Member

Chuxel commented Feb 14, 2022

@awmcclain You can add a reference to the script in your Dockerfile instead until this is deployed in Codespaces. @joshspicer is working on that. See https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/go.md

EDIT: You should also be able to reference microsoft/vscode-dev-containers/golang in your feature list instead of go.

@joshspicer
Copy link
Member

joshspicer commented Feb 14, 2022

(Additionally to what Chuck has suggested, if you're using devcontainer features)

The cached version of this script in Codespaces currently tied to a slightly slower release schedule - it should be deployed in the next day or two. (And we're actively working on decoupling to prevent situations like this in the future!)

In the meantime you may want to try our preview functionality we're dubbing "remote feature", by changing your features reference from the shorthand golang to:

	"features": {
		"microsoft/vscode-dev-containers/golang": "latest"
	},

This will dynamically pull the very latest devcontainer-features.tgz release artifact from the vscode-dev-containers repo.

Please note this functionality is in preview and we're actively moving bits of this functionality around. Long-term, we hope to stop pre-packaging these scripts and dynamically fetch them, to alleviate situations where codespaces gets out of sync (especially when an upstream change breaks us and we want to push out fixes fast!)

image

Example repo: https://github.com/joshspicer/codespace-features-example/tree/go
Discussions regarding features (if you want to add your thoughts, issues in the dev-container-spec repo will have the most visibility to the team): devcontainers/spec#8

@hyangah
Copy link
Contributor

hyangah commented Feb 14, 2022

fyi dlv@master build is fixed.

@Chuxel
Copy link
Member

Chuxel commented Feb 16, 2022

Closing since the core situation has been resolved and we've got updated scripts to handle something happening down the road. Thanks!

@Chuxel Chuxel closed this as completed Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug go upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants