Closed jcsobrino closed 1 week ago
Hi @jcsobrino, thanks for reporting the issue. I could not reproduce the behavior on my machine. When I try to re-run sam publish
to update the application, the create_application
API throws the error ConflictException('An error occurred (ConflictException) when calling the CreateApplication operation: Application with id <Application-id> already exists.')
. Here's the project I used:
template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
sam-app-6566
Sample SAM Template for sam-app-6566
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 3
MemorySize: 128
Metadata:
AWS::ServerlessRepo::Application:
Author: user
Description: description
HomePageUrl: https://github.com/test/test
Labels:
- test-app
LicenseUrl: ./LICENSE.txt
Name: sam-app-6566
ReadmeUrl: ./README.md
SemanticVersion: 0.0.1
SourceCodeUrl: https://github.com/test/test
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /hello
Method: get
directory
├── .gitignore
├── LICENSE.txt
├── README.md
├── __init__.py
├── events
│ └── event.json
├── hello_world
│ ├── __init__.py
│ ├── app.py
│ └── requirements.txt
├── packaged.yaml
├── samconfig.toml
├── template.yaml
Can you provide a sample app for us to reproduce the behavior and the steps to update which results in the error? This seems similar to the issue, but would like to reproduce the behavior before marking this as a bug.
Closing due to inactivity. If the issue persists, please open a new issue.
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.
Description:
SAM CLI publish command fails updating an already existing serverless application. Diving into the code, we have observed SAM CLI firstly tries to create the application. If it already exists, it extracts from the error message the Application ID. Then, it updates the application with that Application ID.
However, in our case, AWS returns this error message:
instead of something like this:
So, the regular expression does not match with the error message, it cannot extract the Application ID and the updating operation fails.
Steps to reproduce:
We execute these commands in a GitHub action, but the result it is the same from the shell in a local computer. The error raises in the last command.
Observed result:
Expected result:
The serverless application is updated successfully.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.105.0