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

aws-lambda-python-alpha: panic: JsiiError: @jsii/kernel.Fault Module '@aws-cdk/aws-lambda-python-alpha' not found #4727

Open
1 task
kaykhan opened this issue Dec 16, 2024 · 1 comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@kaykhan
Copy link

kaykhan commented Dec 16, 2024

Describe the bug

I want to deploy a python function using https://docs.aws.amazon.com/cdk/api/v2/docs/aws-lambda-python-alpha-readme.html

However i get the error panic: JsiiError: @jsii/kernel.Fault Module '@aws-cdk/aws-lambda-python-alpha' not found
when i run any cdk command.

I installed using.

go get -u github.com/aws/aws-cdk-go/awscdklambdapythonalpha/v2

go: downloading github.com/aws/jsii-runtime-go v1.105.0
go: downloading github.com/aws/constructs-go v0.0.0-20241014125741-52e7ddc71aae
go: downloading github.com/aws/constructs-go/constructs v0.0.0-20210203051210-8754df3d2bfd
go: downloading github.com/cdklabs/cloud-assembly-schema-go v0.0.0-20241216002747-b2fc8a3ba4cb
go: downloading github.com/cdklabs/awscdk-asset-kubectl-go v0.0.0-20241010141422-eef99ab750e0
go: downloading github.com/cdklabs/awscdk-asset-awscli-go/awscliv1 v0.0.13
go: downloading github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20 v0.0.21
go: downloading github.com/cdklabs/awscdk-asset-awscli-go v0.0.0-20241209155413-94cd21215ea0
go: downloading github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.214
go: downloading github.com/cdklabs/awscdk-asset-node-proxy-agent-go v0.0.0-20240903093635-1dfb93ea640b
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/Masterminds/semver/v3 v3.3.1
go: downloading github.com/fatih/color v1.18.0
go: downloading golang.org/x/tools v0.27.0
go: downloading golang.org/x/mod v0.22.0
go: upgraded github.com/Masterminds/semver/v3 v3.3.0 => v3.3.1
go: upgraded github.com/aws/jsii-runtime-go v1.104.0 => v1.105.0
go: upgraded github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.208 => v2.2.214
go: upgraded github.com/fatih/color v1.17.0 => v1.18.0
go: upgraded golang.org/x/mod v0.21.0 => v0.22.0
go: upgraded golang.org/x/tools v0.26.0 => v0.27.0
	DocumentXBRLParserStack(app, fmt.Sprintf("market-data-%s-%s-xbrl-parser", providerName, pipelineName), &CHStreamFilingDocumentLib.DocumentXBRLParserStackProps{
		Environment: environment,
		StackProps: awscdk.StackProps{
			StackName: jsii.String(fmt.Sprintf("market-data-%s-%s-xbrl-parser", providerName, pipelineName)),
			Env:       env(),
		},
		Dependency: CHStreamFilingDocumentLib.DocumentXBRLParserStackDependencyProps{
			PipelineName: pipelineName,
			ProviderName: providerName,
		},
	})
	
	
...
func DocumentXBRLParserStack(scope constructs.Construct, id string, props *DocumentXBRLParserStackProps) awscdk.Stack {
	var sprops awscdk.StackProps
	if props != nil {
		sprops = props.StackProps
	}
	stack := awscdk.NewStack(scope, &id, &sprops)
	name := *stack.StackName()
	pipelineName := props.Dependency.PipelineName
	providerName := props.Dependency.ProviderName
	serviceName := pipelineName + "xbrl-parser"

	awscdklambdapythonalpha.NewPythonFunction(stack, jsii.String(fmt.Sprintf("%s-lfn", name)), &awscdklambdapythonalpha.PythonFunctionProps{
		FunctionName: jsii.String(name),
		Runtime:      awslambda.Runtime_PYTHON_3_8(),
		Entry:        jsii.String(fmt.Sprintf("src/%s/stream/filings/document/xbrl/parser", providerName)),
		Environment: &map[string]*string{
			"ENV":           &props.Environment,
			"STACK_NAME":    &name,
			"SERVICE_NAME":  &serviceName,
			"PIPELINE_NAME": &pipelineName,
			"PROVIDER_NAME": &providerName,
		},
		Timeout:                      awscdk.Duration_Seconds(jsii.Number(60)),
		ReservedConcurrentExecutions: jsii.Number(2),
	})

	return stack
}

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Expect to be able to use awscdklambdapythonalpha construct to deploy a python function in my go code.

Current Behavior

cdk ls --app "go run bin/ch/main.go"

panic: JsiiError: @jsii/kernel.Fault Module '@aws-cdk/aws-lambda-python-alpha' not found

goroutine 1 [running]:
github.com/aws/jsii-runtime-go/internal/kernel.(*Client).CastPtrToRef(0xc000132060, {0x10147a0?, 0x617a180?, 0x10?})
        /home/kay/go/1.22.4/pkg/mod/github.com/aws/jsii-runtime-go@v1.105.0/internal/kernel/conversions.go:207 +0x6e6
github.com/aws/jsii-runtime-go/internal/kernel.(*Client).CastPtrToRef(0xc000132060, {0xfff720?, 0xc00052a388?, 0x4?})
        /home/kay/go/1.22.4/pkg/mod/github.com/aws/jsii-runtime-go@v1.105.0/internal/kernel/conversions.go:203 +0x59b
github.com/aws/jsii-runtime-go/internal/kernel.(*Client).CastPtrToRef(0xc000132060, {0xf246a0?, 0xc0006ca9d0?, 0x4?})
        /home/kay/go/1.22.4/pkg/mod/github.com/aws/jsii-runtime-go@v1.105.0/internal/kernel/conversions.go:189 +0x8e7
github.com/aws/jsii-runtime-go/internal/kernel.(*Client).CastPtrToRef(0xc000132060, {0xf246e0?, 0xc0006ca788?, 0x4ab405?})
        /home/kay/go/1.22.4/pkg/mod/github.com/aws/jsii-runtime-go@v1.105.0/internal/kernel/conversions.go:189 +0x8e7
github.com/aws/jsii-runtime-go/runtime.convertArguments({0xc0006bbaa8, 0x3, 0x10195a0?})
        /home/kay/go/1.22.4/pkg/mod/github.com/aws/jsii-runtime-go@v1.105.0/runtime/runtime.go:381 +0xef
github.com/aws/jsii-runtime-go/runtime.Create({0x122db8d, 0x27}, {0xc0006bbaa8, 0x3, 0x3}, {0x11cf800, 0xc000549a00})
        /home/kay/go/1.22.4/pkg/mod/github.com/aws/jsii-runtime-go@v1.105.0/runtime/runtime.go:196 +0xb50
github.com/aws/aws-cdk-go/awscdklambdagoalpha/v2.NewGoFunction({0x7f4ca1c38a20, 0xc000527dd0}, 0xc000549770, 0xc0006ca788)
        /home/kay/go/1.22.4/pkg/mod/github.com/aws/aws-cdk-go/awscdklambdagoalpha/v2@v2.149.0-alpha.0/GoFunction.go:511 +0x112
market-data/lib/ch/filings.FilingsStreamProcessorStack({0x7f4ca1c38938, 0xc0005124d0}, {0xc0004f6de0, 0x27}, 0xc0000e2c60)
        /home/kay/kay/market-data/lib/ch/filing_stream_processor.go:58 +0x9bd
main.main()
        /home/kay/kay/market-data/bin/ch/main.go:32 +0x539
exit status 2
Subprocess exited with error 1

Reproduction Steps

go get -u github.com/aws/aws-cdk-go/awscdklambdapythonalpha/v2

Possible Solution

No response

Additional Information/Context

CDK CLI Version

2.173.1 (build 4eac959)

Node.js Version

20.14

OS

Ubuntu 24

Language

Go 1.23.3

SDK version used

jsii-runtime-go v1.105.0

Environment details (OS name and version, etc.)

Ubuntu

@kaykhan kaykhan added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 16, 2024
@kaykhan
Copy link
Author

kaykhan commented Dec 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant