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

+x executable bit not being set on uploaded AssetCode for golang lambdas #3498

Closed
1 of 5 tasks
wizardishungry opened this issue Jul 31, 2019 · 2 comments
Closed
1 of 5 tasks
Labels
needs-triage This issue or PR still needs to be triaged.

Comments

@wizardishungry
Copy link

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior?

from aws_cdk import (
    aws_ec2 as ec2,
    aws_ecs as ecs,
    aws_ecs_patterns as ecs_patterns,
    aws_apigateway as apigw,
    aws_lambda as lambda_,
    core,
)

class Sibyl(core.Stack):

    def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
        super().__init__(scope, id, *kwargs)

        web = lambda_.Function(
            self, "web",
            code=lambda_.AssetCode.asset("bin"),
            handler="httpd",
            runtime=lambda_.Runtime.GO_1_X
        )

        api = apigw.RestApi(self, "api",
            rest_api_name="Quotes",
            description="This does stuff"
        )

        integration = apigw.LambdaIntegration(web)
        api.root.add_proxy(
            default_integration=integration,
        )

        
app = core.App()
Sibyl(app, "sibyl")
app.synth()

Deploy and try to hit a url. CloudWatch logs:

fork/exec /var/task/httpd: permission denied: PathError
null

If I mess around with the handler path:

fork/exec /var/task/./bin/httpd: no such file or directory: PathError null 

Comparing zipinfo with serverless's output:

$ zipinfo .serverless/httpd.zip 
Archive:  .serverless/httpd.zip
Zip file size: 4309367 bytes, number of entries: 1
-rwxr-xr-x  4.5 unx 10067040 bl defN 80-Jan-01 00:00 bin/httpd
1 file, 10067040 bytes uncompressed, 4309235 bytes compressed:  57.2%

With the CDK asset zip I downloaded from S3:

$ zipinfo /Users/jonwilliams/Downloads/6d27f27d59cc0ed270439e7bca00df1033689146b3389c1e02b7ad3b93ce9518.zip
Archive:  /Users/jonwilliams/Downloads/6d27f27d59cc0ed270439e7bca00df1033689146b3389c1e02b7ad3b93ce9518.zip
Zip file size: 9286087 bytes, number of entries: 2
-rw-r--r--  4.5 unx 10071136 bl defN 80-Jan-01 00:00 httpd
-rw-r--r--  4.5 unx 12544352 bl defN 80-Jan-01 00:00 polld

No executable bit.

  • What is the expected behavior (or behavior of feature suggested)?
    The lambda executes.

  • What is the motivation / use case for changing the behavior or adding this feature?
    Suppporting golang lambdas.

  • Please tell us about your environment:

    • CDK CLI Version: 1.2.0 (build 6b763b7)
    • Module Version: 1.2.0
    • OS: OSX Mojave
    • Language: Python
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

@wizardishungry wizardishungry added the needs-triage This issue or PR still needs to be triaged. label Jul 31, 2019
@jogold
Copy link
Contributor

jogold commented Aug 1, 2019

Should be fixed with #3428, can you test once this is released with the next version?

@jogold
Copy link
Contributor

jogold commented Aug 2, 2019

@eladb eladb closed this as completed Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants