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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigError: Missing region in config #308

Closed
richard-smith-sky opened this issue Jan 17, 2020 · 23 comments
Closed

ConfigError: Missing region in config #308

richard-smith-sky opened this issue Jan 17, 2020 · 23 comments
Labels

Comments

@richard-smith-sky
Copy link

richard-smith-sky commented Jan 17, 2020

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Bug Report

We have a deployment that relies on serverless-domain-manager which has worked happily for 2 years and then suddenly stopped. It is run locally and remotely on BitBucket Pipelines, which is where we see the failure. Has something changed about the handling of regions? Needless-to-say the region is defined in the serverless configuration.

provider:
  name: aws
  runtime: nodejs12.x
  region: eu-west-2
  tracing: true
>> serverless create_domain -s staging
 
  Error --------------------------------------------------
 
  Error: Error: 'www.mysite.world' was not created in API Gateway.
  ConfigError: Missing region in config
      at createDomainName.catch (/opt/atlassian/pipelines/agent/build/node_modules/serverless-domain-manager/index.js:108:15)
      at <anonymous>
      at process._tickDomainCallback (internal/process/next_tick.js:229:7)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              8.17.0
     Framework Version:         1.61.2
     Plugin Version:            3.2.7
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0
@jconstance-amplify
Copy link
Collaborator

@medikoo Any chance this is related to your change?

@tylercd100
Copy link

tylercd100 commented Jan 17, 2020

This is happening to me too. I'm getting missing region in config error now and our deployments have been working perfectly for the past year.

Serverless: [AWS apigateway undefined 0.002s 0 retries] getDomainName({ domainName: 'staging.aldermarketing.com' })
 
  Error --------------------------------------------------
 
  Error: Error: Could not set up basepath mapping. Try running sls create_domain first.
  Error: Error: 'staging.aldermarketing.com' could not be found in API Gateway.
  ConfigError: Missing region in config
      at getDomain.then.then.catch (/home/circleci/app/src/node_modules/serverless-domain-manager/index.js:181:15)
      at processTicksAndRejections (internal/process/next_tick.js:81:5)
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
      at getHooks.reduce.then (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:24)
  From previous event:
      at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:8)
      at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:133:33)
      at processImmediate (timers.js:637:19)
      at process.topLevelDomainCallback (domain.js:126:23)
  From previous event:
      at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:120:74)
      at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:75:30)
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:136:16
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:57:14
      at FSReqCallback.args [as oncomplete] (fs.js:145:20)
  From previous event:
      at initializeErrorReporter.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:75:8)
      at processImmediate (timers.js:637:19)
      at process.topLevelDomainCallback (domain.js:126:23)
  From previous event:
      at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless.js:64:4)
      at Module._compile (internal/modules/cjs/loader.js:738:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
      at Module.load (internal/modules/cjs/loader.js:630:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
      at Function.Module._load (internal/modules/cjs/loader.js:562:3)
      at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
      at internal/main/run_main_module.js:21:11

@tylercd100
Copy link

Could it be this most recent change? 633a506

@medikoo
Copy link
Contributor

medikoo commented Jan 17, 2020

This looks as duplicate of #306 which was fixed in #307

Are you relying on latest version of a plugin?

@tylercd100
Copy link

I just barely updated to v3.3.1 and it is working for me. @spotnape can you check if the latest version fix your issue?

Thanks @medikoo

@jconstance-amplify
Copy link
Collaborator

I was also able to verify that it was working with the latest version of the plugin.

@brycehemme
Copy link

I was experiencing the same issue on serverless-domain-manager version 3.3.0. Bumping to 3.3.1 has fixed the issue for me.

@richard-smith-sky
Copy link
Author

Thanks all. Bumping the version has resolved our problem too.

@shierro
Copy link

shierro commented Jan 22, 2020

same here. bumping to 3.3.1 solved issue
OS: MacOS 10.15.2

Framework Core: 1.61.3
Plugin: 3.2.7
SDK: 2.2.1
Components Core: 1.1.2
Components CLI: 1.4.0

@gleidsonh
Copy link

It works on 3.3.1.
OS: Win10

$ serverless --version
Framework Core: 1.61.3
Plugin: 3.2.7
SDK: 2.3.0
Components Core: 1.1.2
Components CLI: 1.4.0

@jconstance-amplify
Copy link
Collaborator

Okay, sounds like this is definitely resolved by bumping to 3.3.1. Thanks for confirming folks.

@rbjoshi
Copy link

rbjoshi commented Jan 23, 2020

I was getting the above error and I updated serverless to 1.61.3 and serverless-domain-manager to 3.3.1 and now I am getting below error while trying to deploy

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

Serverless plugin "serverless-domain-manager" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.

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

Your Environment Information ---------------------------
Operating System: linux
Node Version: 8.10.0
Framework Version: 1.61.3
Plugin Version: 3.2.7
SDK Version: 2.3.0
Components Core Version: 1.1.2
Components CLI Version: 1.4.0

@gleidsonh
Copy link

I was getting the above error and I updated serverless to 1.61.3 and serverless-domain-manager to 3.3.1 and now I am getting below error while trying to deploy

Serverless Error ---------------------------------------
Serverless plugin "serverless-domain-manager" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: linux
Node Version: 8.10.0
Framework Version: 1.61.3
Plugin Version: 3.2.7
SDK Version: 2.3.0
Components Core Version: 1.1.2
Components CLI Version: 1.4.0

You must have it on your serverless.yml

plugins:
  - serverless-offline
  - serverless-plugin-include-dependencies
  - serverless-domain-manager

@rbjoshi
Copy link

rbjoshi commented Jan 23, 2020

I was getting the above error and I updated serverless to 1.61.3 and serverless-domain-manager to 3.3.1 and now I am getting below error while trying to deploy

Serverless Error ---------------------------------------
Serverless plugin "serverless-domain-manager" not found. Make sure it's installed and listed in the "plugins" section of your serverless config file.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: linux
Node Version: 8.10.0
Framework Version: 1.61.3
Plugin Version: 3.2.7
SDK Version: 2.3.0
Components Core Version: 1.1.2
Components CLI Version: 1.4.0

You must have it on your serverless.yml

plugins:
  - serverless-offline
  - serverless-plugin-include-dependencies
  - serverless-domain-manager

@gleidsonh It was there in the serverless.yml but still getting the issue

@gleidsonh
Copy link

I was getting the above error and I updated serverless to 1.61.3 and serverless-domain-manager to 3.3.1 and now I am getting below error while trying to deploy

You must have it on your serverless.yml

plugins:
  - serverless-offline
  - serverless-plugin-include-dependencies
  - serverless-domain-manager

@gleidsonh It was there in the serverless.yml but still getting the issue

Maybe indentation is incorrect, plugins: must to be glued to the left.

@rbjoshi
Copy link

rbjoshi commented Jan 24, 2020

I was getting the above error and I updated serverless to 1.61.3 and serverless-domain-manager to 3.3.1 and now I am getting below error while trying to deploy

You must have it on your serverless.yml

plugins:
  - serverless-offline
  - serverless-plugin-include-dependencies
  - serverless-domain-manager

@gleidsonh It was there in the serverless.yml but still getting the issue

Maybe indentation is incorrect, plugins: must to be glued to the left.

@gleidsonh The indentations is as you described, it was working with the older version, but now I am getting the above error

yml snippet

plugins:
  - serverless-plugin-warmup
  - serverless-offline
  - serverless-log-forwarding
  - serverless-domain-manager

custom:
  warmup:
    schedule: 'cron(0/10 12-23 ? * MON-FRI *)'
    prewarm: true
  headers:
    - Content-Type
    - X-Amz-Date
    - Authorization
    - X-Api-Key
    - X-Amz-Security-Token
    - TS-Staging
    - x-tss-correlation-id
    - x-tss-application-id

@gleidsonh
Copy link

I was getting the above error and I updated serverless to 1.61.3 and serverless-domain-manager to 3.3.1 and now I am getting below error while trying to deploy

You must have it on your serverless.yml

plugins:
  - serverless-offline
  - serverless-plugin-include-dependencies
  - serverless-domain-manager

@gleidsonh It was there in the serverless.yml but still getting the issue

Maybe indentation is incorrect, plugins: must to be glued to the left.

@gleidsonh The indentations is as you described, it was working with the older version, but now I am getting the above error

Is it on package.json, right? Try to remove node_modules and install again. If you are using yarn, clean cache before install.

@rbjoshi
Copy link

rbjoshi commented Jan 24, 2020

I was getting the above error and I updated serverless to 1.61.3 and serverless-domain-manager to 3.3.1 and now I am getting below error while trying to deploy

You must have it on your serverless.yml

plugins:
  - serverless-offline
  - serverless-plugin-include-dependencies
  - serverless-domain-manager

@gleidsonh It was there in the serverless.yml but still getting the issue

Maybe indentation is incorrect, plugins: must to be glued to the left.

@gleidsonh The indentations is as you described, it was working with the older version, but now I am getting the above error

Is it on package.json, right? Try to remove node_modules and install again. If you are using yarn, clean cache before install.

I removed node_module from the project and package-lock.json and installed the npm from scratch and upgraded the serverless-domain-manager but still getting the issue. I am new to the serverless. Is it compatible with node8.10 ?

@gleidsonh
Copy link

@rbjoshi Probably AWS no longer allows 8.10, only nodejs10.x and nodejs12.x. Try to update your local npm and serverless.yml. If doesn't works, please submit to a public repository. I'll try to see what's going on.

@rbjoshi
Copy link

rbjoshi commented Jan 25, 2020

@rbjoshi Probably AWS no longer allows 8.10, only nodejs10.x and nodejs12.x. Try to update your local npm and serverless.yml. If doesn't works, please submit to a public repository. I'll try to see what's going on.

I have created a issue #310 , can you check what am I missing there?

@shvhh
Copy link

shvhh commented Jul 28, 2020

it got fixed when I use

AWS.config.update({
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  region: process.env.AWS_REGION
});

instead of

const config = new AWS.Config({
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  region: process.env.AWS_REGION
}) 

@Vadorequest
Copy link

Just encountered the same issue.

Got it fixed by bumping from 3.2.2 to 3.3.2.

@himharsh1997
Copy link

AWS_REGION is missing in env.local causing issue on service like s3 getting used in the project.

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

No branches or pull requests