justinram11 / serverless-aws-batch

MIT License
26 stars 26 forks source link

Error deploy sample project #2

Closed joviwap closed 5 years ago

joviwap commented 5 years ago

I have created a very basic project that looks like this:

service: test-batch

provider:
  name: aws
  runtime: nodejs10.x
  region: eu-west-1

  batch:
    Type: EC2
    SecurityGroupIds:
      - sg-11111111111111111111
    Subnets: 
      - vpc-11111111
    InstanceTypes:
      - c4.large

functions:
  batchhello:
    handler: handler.hello
    events:
      - http:
         path: hello
         method: get
    batch:
      ContainerProperties:
        Memory: 128
        Vcpus: 1
      RetryStrategy:
        Attempts: 1
      Timeout:
        AttemptDurationSeconds: 3600

plugins:
  - serverless-aws-batch

I following error output

Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building docker image: "015414317816.dkr.ecr.eu-west-1.amazonaws.com/test-batch-dev:latest"...
Sending build context to Docker daemon   5.12kB
Step 1/7 : FROM justinram11/lambda:build-nodejs10.x
 ---> 6d1f26602686
Step 2/7 : USER root
 ---> Using cache
 ---> 0f0c4d20ac27
Step 3/7 : COPY test-batch.zip /tmp
 ---> Using cache
 ---> 01d734f305c3
Step 4/7 : RUN cd /tmp && unzip test-batch.zip && rm test-batch.zip
 ---> Using cache
 ---> 91855027f263
Step 5/7 : FROM justinram11/lambda:nodejs10.x
 ---> fa15b0b1116e
Step 6/7 : COPY --from=0 /tmp/* /var/task/
 ---> Using cache
 ---> 7805fb395b43
Step 7/7 : RUN rm -rf /tmp/*
 ---> Using cache
 ---> 7c36f90f2117
Successfully built 7c36f90f2117
Successfully tagged 015414317816.dkr.ecr.eu-west-1.amazonaws.com/test-batch-dev:latest
Serverless: Generating AWS Batch
Serverless: Building lambda schedule artifact for: "batchhello"...
Serverless: Logging into ECR...
Serverless: Uploading to ECR...
The push refers to repository [015414317816.dkr.ecr.eu-west-1.amazonaws.com/test-batch-dev]
00936a051a9c: Layer already exists 
813fc15cd24d: Layer already exists 
c1223fbbba40: Layer already exists 
0a39dd2b9db6: Layer already exists 
latest: digest: sha256:c6a4336c2f702549b1721c0ee9bbd47ce9fa2c55333e312ea95ad6615de69f12 size: 1160
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service batchhello.zip file to S3 (2.15 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
....................................................
Serverless: Operation failed!
Serverless: View the full error output: https://eu-west-1.console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aeu-west-1%3A015414317816%3Astack%2Ftest-batch-dev%2F2b93fdd0-eab5-11e9-83b6-0212c97b1f72

  Serverless Error ---------------------------------------

  An error occurred: BatchhelloLambdaVersionLt4xAGb2Tg54Eo1La1x2H5rkFO6gS9JbPhYBVwBOk - CodeSHA256 (47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=) is different from current CodeSHA256 in $LATEST (Bc/bYGG3FJi3+p+cQOpzJLfo1nhM6nxuT/aKURBfeFo=). Please try again with the CodeSHA256 in $LATEST. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 1cd9083e-618c-4dcc-a868-d054c7d807d1).

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              8.4.0
     Framework Version:         1.53.0
     Plugin Version:            3.1.0
     SDK Version:               2.1.1
     Components Core Version:   1.1.1
     Components CLI Version:    1.2.3

Thank you in advance for your help

justinram11 commented 5 years ago

Hey @joviwap ,

Can you please tell me what error your Cloudformation stack is reporting at: https://eu-west-1.console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aeu-west-1%3A015414317816%3Astack%2Ftest-batch-dev%2F2b93fdd0-eab5-11e9-83b6-0212c97b1f72

Thanks!

joviwap commented 5 years ago

I was trying again and the problem disappeared. I will be doing some test during the next days. I will close the issue and if I have the problem again I will reopen the issue the Cloudformation stack report.

Thank you! :)