Error Could not set up basepath mapping

I am suddenly getting following error when I want to deploy my application through serverless/lambda?

 sls deploy

  Error --------------------------------------------------
  Error: Error: Could not set up basepath mapping. Try running sls create_domain first.
  Error: Error: 'aaaa-dev.sss-vvvv.GGGG.com' could not be found in API Gateway.
  ConfigError: Missing region in config
      at /home/mhadi/vvvv/admonisher/node_modules/serverless-domain-manager/index.js:181:15
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
      at /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 /usr/local/lib/node_modules/serverless/lib/Serverless.js:133:33
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:130:23)
  From previous event:
      at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:120:74)
      at /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.oncomplete (fs.js:146:23)
  From previous event:
      at /usr/local/lib/node_modules/serverless/bin/serverless.js:75:8
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:130: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:959:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
      at Module.load (internal/modules/cjs/loader.js:815:32)
      at Function.Module._load (internal/modules/cjs/loader.js:727:14)
      at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
      at internal/main/run_main_module.js:17:11
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              12.13.1
     Framework Version:         1.61.3
     Plugin Version:            3.2.7
     SDK Version:               2.3.0
     Components Core Version:   1.1.2

When I am running following command I am getting this error

  sls create_domain
  Error: Error: 'aaaa-dev.sss-vvvv.GGGG.com' was not created in API Gateway.
  ConfigError: Missing region in config

Can somebody help please?

1 Like

Getting the same issue.

Solution:

Export the following variable:

AWS_REGION='eu-west-1'

Or any other region that you want to deploy your app to.

1 Like

Thanks @mhadi. It worked.
You are awesome (y)