# Stage name issue after deployment

**URL:** <https://forum.serverless.com/t/stage-name-issue-after-deployment/2849>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [October 10, 2017, 7:19am UTC](https://forum.serverless.com/t/stage-name-issue-after-deployment/2849 "2017-10-10T07:19:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianhuangyl](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@brianhuangyl](https://forum.serverless.com/u/brianhuangyl)\
**Post date:** [October 10, 2017, 7:19am UTC](https://forum.serverless.com/t/stage-name-issue-after-deployment/2849/1 "2017-10-10T07:19:36Z")

</div>

In the `serverless.yml` file, I was using interpolation to generate stage value. And I got the following errors after running `sls deploy`.

```auto
# serverless.yml
provider:
  name: aws
  runtime: nodejs6.10
  memorySize: 512
  timeout: 30
  stage: ${self:custom.CONFIG.STAGE, 'dev'} 
  region: ${self:custom.CONFIG.REGION}
custom:
  CONFIG: ${file(config.yml):env}

```

```auto
# config.yml
env:
  STAGE: dev
  REGION: ap-southeast-2

```

```auto
# Error log 
Serverless: 'Too many requests' received, sleeping 5 seconds
Serverless: 'Too many requests' received, sleeping 5 seconds
Serverless: 'Too many requests' received, sleeping 5 seconds
 
  Serverless Error ---------------------------------------
 
  Stage name only allows a-zA-Z0-9_

```

This error can be fixed by using static values like ‘dev’ or ‘production’.

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [October 10, 2017, 7:37am UTC](https://forum.serverless.com/t/stage-name-issue-after-deployment/2849/2 "2017-10-10T07:37:15Z")

</div>

Can you include your config.yml?

---

<div class="post-metadata">

**Author:** ![brianhuangyl](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@brianhuangyl](https://forum.serverless.com/u/brianhuangyl)\
**Post date:** [October 10, 2017, 8:00am UTC](https://forum.serverless.com/t/stage-name-issue-after-deployment/2849/3 "2017-10-10T08:00:43Z")

</div>

Just updated. Actually, it might not be caused by the file `config.yml`, coz even I change it to `stage: ${opt.stage, 'dev'}`, the error still can be reproduced. But using `stage: dev` works well.

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [October 10, 2017, 8:37am UTC](https://forum.serverless.com/t/stage-name-issue-after-deployment/2849/4 "2017-10-10T08:37:48Z")

</div>

Did you mean `${opt.stage, 'dev'}` because it should be `${opt:stage, 'dev'}`

---

<div class="post-metadata">

**Author:** ![brianhuangyl](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@brianhuangyl](https://forum.serverless.com/u/brianhuangyl)\
**Post date:** [October 11, 2017, 2:23am UTC](https://forum.serverless.com/t/stage-name-issue-after-deployment/2849/5 "2017-10-11T02:23:05Z")

</div>

Yes, that was a typo. It should be `${opt:stage, 'dev'}`. Even the using the correct syntax, I still keep getting same error.
