Hi everybody ! I'm currently trying to run pulumi ...
# getting-started
b
Hi everybody ! I'm currently trying to run pulumi go integration tests on a personal projet on my Mac. I got a simple folder deploying some cloud resources. And the integration code testing it:
Copy code
package e2e

import (
	"os"
	"path"
	"testing"

  "<http://github.com/pulumi/pulumi/pkg/v3/testing/integration|github.com/pulumi/pulumi/pkg/v3/testing/integration>"
)

func TestClusterCreation(t *testing.T) {
  cwd, err := os.Getwd()
	if err != nil {
		t.FailNow()
	}

  integration.ProgramTest(t, &integration.ProgramTestOptions{
    Dir:         path.Join(cwd, "../", "01-cluster"),
    Quick:       true,
    SkipRefresh: true,
    Verbose: true,
  })
}
I ran this command
PULUMI_TEST_DEBUG_LOG_LEVEL=9 go test -v ./e2e
And i got this error:
Copy code
=== RUN   TestClusterCreation
=== PAUSE TestClusterCreation
=== CONT  TestClusterCreation
    program.go:1935: sample: /Users/ulysse.fontaine/Octo/dojo-investigation-kubernetes/01-cluster
    program.go:1940: pulumi: /opt/homebrew/bin/pulumi
    program.go:1086: acquired yarn install lock
    command.go:46: **** Invoke '/opt/homebrew/bin/yarn install' in '/var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/p-it-amafh4nw9h-01-cluster-77c45e92-3322497897'
yarn install v1.22.22
warning package.json: No license field
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning cluster.dkusr: No license field
[1/4] Resolving packages...
warning @pulumi/pulumi > @opentelemetry/instrumentation > @opentelemetry/api-metrics@0.32.0: Please use @opentelemetry/api >= 1.3.0
warning @pulumi/pulumi > @opentelemetry/instrumentation-grpc > @opentelemetry/api-metrics@0.32.0: Please use @opentelemetry/api >= 1.3.0
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 42.25s.
    command.go:121: Command completed without output
    program.go:1112: released yarn install lock
    program.go:2085: projdir: /var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/p-it-amafh4nw9h-01-cluster-77c45e92-3322497897
    program.go:1336: Initializing project (dir /var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/p-it-amafh4nw9h-01-cluster-77c45e92-3322497897; stack p-it-amafh4nw9h-01-cluster-77c45e92)
    command.go:46: **** Invoke '/opt/homebrew/bin/pulumi --logflow --logtostderr -v=9 login --cloud-url file:///var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/TestClusterCreation1686706941/001' in '/var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/p-it-amafh4nw9h-01-cluster-77c45e92-3322497897'
Logged in to AMAFH4NW9HXFM as ulysse.fontaine (file:///var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/TestClusterCreation1686706941/001)
    command.go:121: Command completed without output
    command.go:46: **** Invoke '/opt/homebrew/bin/pulumi --logflow --logtostderr -v=9 stack init p-it-amafh4nw9h-01-cluster-77c45e92' in '/var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/p-it-amafh4nw9h-01-cluster-77c45e92-3322497897'
I0327 15:23:16.962283   84321 sink.go:178] defaultSink::Error(error: read ".pulumi/meta.yaml": blob (key ".pulumi/meta.yaml") (code=Unknown): AccessDenied: Access Denied
	status code: 403, request id: txg60eb60decea34619a52e-0066042bd5, host id: txg60eb60decea34619a52e-0066042bd5)
error: read ".pulumi/meta.yaml": blob (key ".pulumi/meta.yaml") (code=Unknown): AccessDenied: Access Denied
	status code: 403, request id: txg60eb60decea34619a52e-0066042bd5, host id: txg60eb60decea34619a52e-0066042bd5
    command.go:98: Invoke '/opt/homebrew/bin/pulumi --logflow --logtostderr -v=9 stack init p-it-amafh4nw9h-01-cluster-77c45e92' failed: exit status 255
    command.go:121: Command completed without output
    program.go:852:
        	Error Trace:	/Users/ulysse.fontaine/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.111.1/testing/integration/program.go:852
        	            				/Users/ulysse.fontaine/Octo/dojo-investigation-kubernetes/e2e/cluster_test.go:17
        	Error:      	Received unexpected error:
        	            	initializing test project: exit status 255
        	Test:       	TestClusterCreation
--- FAIL: TestClusterCreation (86.29s)
FAIL
FAIL	<http://gitlab.com/octo-technology/octo-ops/dojo-investigation-kubernetes/e2e|gitlab.com/octo-technology/octo-ops/dojo-investigation-kubernetes/e2e>	86.924s
FAIL
I feal like it's some permission problem (due to the 403 and AccessDenied error), but I can't figure it out ! The folder
/var/folders/xj/zn3q9lbj7rnbcb069q75vs7r0000gn/T/TestClusterCreation1686706941/001
is created but empty during the tests. Is it beaucoup there is no
.pulumi
folder in it ?
f
You're doing some advanced stuff here. I'm having a hard time following what directory is $cwd when pulumi is running. It seems like it's under
/var
, which is generally owned by root - but your
yarn install
seems to run "fine" (ignoring unrelated warnings).
It could very well be that the folder / file doesn't exist yet - if this is the first time deploying / previewing the stack, it would create it, but you also need a "project" for the stack to exist within; to tell it where to store statefiles and how to encrypt things and such
b
Yes when trying to debug I have to go through pulumi code, $cwd is
/Users/ulysse.fontaine/Octo/dojo-investigation-kubernetes/
But when running integration tests, pulumi creates temporary folders. Thoses are created using system library and return a folder in
/var/folder
I checked permissions on that and they seam right. I'm currently investigating if the issue come from stack creation parameters
Just found out ! My keys expired for my s3 backend... The error message is not that clear but updating my key make it work !
m
Sorry you hit this! It's a known issue -- we'll see if we can get it documented: https://github.com/pulumi/pulumi-hugo/issues/4146