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

Migrating CFN custom resource from go1.x to provided.al2? #6235

Closed
msummers-nr opened this issue Nov 9, 2023 · 4 comments
Closed

Migrating CFN custom resource from go1.x to provided.al2? #6235

msummers-nr opened this issue Nov 9, 2023 · 4 comments
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@msummers-nr
Copy link

msummers-nr commented Nov 9, 2023

I'm trying to migrate a working Go CloudFormation custom resource from go1.x to provided.al2 and having no luck.

I've done everything in the migration doc (including hacking Makefile and makebuild generation) and if I'm reading the stack trace correctly the Lambda is not responding:

2023-11-09 10:54:24,502 | Starting a timer for 180 seconds for function 'LiveTest'                                                                                                                                                                                                                                                                                                                                                        
START RequestId: 58da94ff-6a86-4c1d-8405-8df801096fe8 Version: $LATEST
09 Nov 2023 16:54:24,508 [ERROR] (rapid) Failed to reserve: AlreadyReserved
2023-11-09 10:54:24,509 | Failed to deserialize response from RIE, returning the raw response as is                                                                                                                                                                                                                                                                                                                                       
2023-11-09 10:54:25,545 | Exception on /2015-03-31/functions/LiveTest/invocations [POST]                                                                                                                                                                                                                                                                                                                                                  
Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                                                                                                        
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/flask/app.py", line 1455, in wsgi_app                                                                                                                                                                                                                                                                                                                  
    response = self.full_dispatch_request()                                                                                                                                                                                                                                                                                                                                                                                               
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                                                               
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/flask/app.py", line 869, in full_dispatch_request                                                                                                                                                                                                                                                                                                      
    rv = self.handle_user_exception(e)                                                                                                                                                                                                                                                                                                                                                                                                    
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                                                                    
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/flask/app.py", line 867, in full_dispatch_request                                                                                                                                                                                                                                                                                                      
    rv = self.dispatch_request()                                                                                                                                                                                                                                                                                                                                                                                                          
         ^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                                                                          
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/flask/app.py", line 852, in dispatch_request                                                                                                                                                                                                                                                                                                           
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)                                                                                                                                                                                                                                                                                                                                                              
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                              
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/samcli/local/lambda_service/local_lambda_invoke_service.py", line 169, in _invoke_request_handler                                                                                                                                                                                                                                                      
    self.lambda_runner.invoke(function_name, request_data, stdout=stdout_stream_writer, stderr=self.stderr)                                                                                                                                                                                                                                                                                                                               
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/samcli/commands/local/lib/local_lambda.py", line 144, in invoke                                                                                                                                                                                                                                                                                        
    self.local_runtime.invoke(                                                                                                                                                                                                                                                                                                                                                                                                            
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/samcli/lib/telemetry/metric.py", line 324, in wrapped_func                                                                                                                                                                                                                                                                                             
    return_value = func(*args, **kwargs)                                                                                                                                                                                                                                                                                                                                                                                                  
                   ^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                                                                  
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/samcli/local/lambdafn/runtime.py", line 201, in invoke                                                                                                                                                                                                                                                                                                 
    container.wait_for_result(                                                                                                                                                                                                                                                                                                                                                                                                            
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/samcli/local/docker/container.py", line 368, in wait_for_result                                                                                                                                                                                                                                                                                        
    stdout.write_bytes(response)                                                                                                                                                                                                                                                                                                                                                                                                          
  File "/usr/local/Cellar/aws-sam-cli/1.100.0/libexec/lib/python3.12/site-packages/samcli/lib/utils/stream_writer.py", line 35, in write_bytes                                                                                                                                                                                                                                                                                            
    self._stream.buffer.write(output)                                                                                                                                                                                                                                                                                                                                                                                                     
    ^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                                                                                                                                                                                                                                                   
AttributeError: '_io.StringIO' object has no attribute 'buffer'                                                                                                                                                                                                                                                                                                                                                                           
2023-11-09 10:54:25 127.0.0.1 - - [09/Nov/2023 10:54:25] "POST /2015-03-31/functions/LiveTest/invocations HTTP/1.1" 500 -

My guess is there's some issue with the lambda.norpc, but that's just a guess.

Has anyone successfully migrated their Go CFN custom resource?

@msummers-nr msummers-nr added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Nov 9, 2023
@hawflau
Copy link
Contributor

hawflau commented Nov 9, 2023

Hi @msummers-nr thanks for raising the issue, it seems like you are hitting this issue, which has already been fixed and released. Could you please install SAM CLI version 1.101.0 and try again?

@hawflau hawflau added blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Nov 9, 2023
@msummers-nr
Copy link
Author

Thanks @hawflau I missed that. I'll try that this morning and update here.

@msummers-nr
Copy link
Author

The SAM CLI upgrade didn't fix the issue, the I/O error is misleading, it occurs after the timeout.

My issue was a stale indirect dependency on aws-lambda-go, updating that to the current v1.41.0 version works.

Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.
Projects
None yet
Development

No branches or pull requests

2 participants