Skip to content

Conversation

savagecx
Copy link

Fixes #644

Description of Issue Fixed
Unable to deploy multiple services using serverless compose when more than one service utilises the serverless domain manager plugin.

Changes proposed in this pull request:

  • Appended a random GUID to the logging section name to make it unique
  • Updated the logging unit tests to take the GUID into account.

Copy link

@renanwilliam
Copy link

Considering this issue only occurs when more than one service is deployed simultaneously, could using the service name instead of a random GUID be a better option?

Globals.serverless.addServiceOutputSection(`${Globals.pluginName} - ${Globals.serverless.service.service}`, summaryList);

@renanwilliam
Copy link

Considering this issue only occurs when more than one service is deployed simultaneously, could using the service name instead of a random GUID be a better option?

Globals.serverless.addServiceOutputSection(`${Globals.pluginName} - ${Globals.serverless.service.service}`, summaryList);

Forget it, doesn't work. I created a fork and tested it in my project, and the error is still present. Your solution works fine.

@renanwilliam
Copy link

After a lot of tests here, I think the best solution is just check if the output is already added before add again:

//src/logging.ts (59)
if (!Globals.serverless?.servicePluginOutputs?.has(Globals.pluginName)) {
  Globals.serverless.addServiceOutputSection(Globals.pluginName, summaryList);
}

it's necessary add this on types line 70:

///src/types.ts (70)
serviceOutputs?: Map<string, any>;
servicePluginOutputs?: Map<string, any>;

@renanwilliam
Copy link

Here are some updates about my tests: it looks like this package doesn't work with serverless compose in the last version.
This removes the error message, but the API mappings are incorrectly created.

@savagecx
Copy link
Author

Here are some updates about my tests: it looks like this package doesn't work with serverless compose in the last version. This removes the error message, but the API mappings are incorrectly created.

Hi @renanwilliam, thanks for testing on your end and sorry for the delay in replying.
I recall having a similar issue but after setting the allowPathMatching parameter to true in my serverless.yml, the API mappings are correctly maintained.
I did not test this with a new endpoint though, only when deploying an existing service with an existing mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

V1 - Unable to create base path mapping for 'xxx.xxx.com': Base path already exists for this domain name
3 participants