question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(cdk-go): malformed module path in Go code generation when attempting to build example

See original GitHub issue

Attempt to get started with the go cdk, initialise and test the example crashed. Tentatively reporting as a bug in case linked to https://github.com/aws/jsii/issues/2842.

Reproduction Steps

Fresh go project following steps in https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-go.html

aws configure mkdir gotest cd gotest cdk init app --language go // comment: this works fine cdk ls -v (or cdk deploy, cdk bootstrap, cdk synth)

What did you expect to happen?

This was an initial check that the toolchain is working by testing the example. I expected ls to build and launch a container to return the names of two existing CDK stacks in this account and region, created in a Typescript project, which seems to work perfectly in the same user session. So I think my AWS creds, cdk and node installations are correct.

What actually happened?

Go build failed with following error (tail of output)

build command-line-arguments: cannot load embed: malformed module path “embed”: missing dot in first path element Subprocess exited with error 1 Error: Subprocess exited with error 1 at ChildProcess.<anonymous> (/home/drskeet/.nvm/versions/node/v14.17.0/lib/node_modules/aws-cdk/lib/api/cxapp/exec.ts:122:23) at ChildProcess.emit (events.js:376:20) at ChildProcess.emit (domain.js:470:12) at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

Environment

  • CDK CLI Version : 1.105.0 (build 4813992)
  • Framework Version:
  • Node.js Version: v14.17.0
  • OS : Kubuntu Linux 5.4.0-58-generic
  • Language (Version): go version go1.16 linux/amd64

Other

Unfortunately I can’t rule out configuration mistakes elsewhere since this was my first attempt to use the Go bindings. I don’t have a known-good version in golang.

Looks like this might be related to https://github.com/aws/jsii/issues/2842? But if so, much easier to reproduce.


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
skeeters1commented, May 26, 2021

Fixed. Local config error: go aliased to go1.16 but /usr/bin/go symlinked to 1.13. Thank you for the key information that it was picking up the wrong go version. Closing.

1reaction
skeeters1commented, May 26, 2021

Many thanks indeed, will try exactly that. Sorry for reporting as a bug, I rather suspected it would be something local. Will poke around in JSII and let you know. Might be relevant for FAQ or installation instructions for full release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

malformed module path "xxxx/xxxx/uuid" missing dot in first ...
The go.mod file should be at the root of your project (in this case, my-api-server/go.mod ). The first part of the module path...
Read more >
[go] cmd/go: remove change 'go get -d' to 'go get' in tests
cmd/go: change 'go get -d' to 'go get' in tests. The -d flag has no effect in module mode. GOPATH tests are left...
Read more >
GenerateCustomBeat returns error for missing github.com ...
Hi all, I'm attempting to create a new custom beat but am hitting some ... github.com/elastic/beats/v7 imports fmt: malformed module path ...
Read more >
Microsoft/vscode-go - Gitter
Hello, I've just switched to use modules and when I try to run a single test by ... XXX: malformed module path "XXX":...
Read more >
Diff - 20939850793927db78c179dcfcd5d4d6f44f2c01^! - vgo
For example, -// -// //go:generate -command foo go tool foo ... The -v flag causes vendor to print the module paths of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found