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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails: Export 'projectName-stageName-ServerlessAliasReference' does not exist #200

Open
Abhijith-Nagaraja opened this issue Feb 4, 2021 · 11 comments

Comments

@Abhijith-Nagaraja
Copy link

Abhijith-Nagaraja commented Feb 4, 2021

I am just getting started with serverless-aws-alias. But as soon as I include this plugin my build fails

Version: 1.8.0

Command: sls deploy

Error Details

 Serverless Error ---------------------------------------
 
  Export 'projectName-stageName-ServerlessAliasReference' does not exist.
 
  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.18.2
     Framework Version:         2.21.1
     Plugin Version:            4.4.2
     SDK Version:               2.3.2
     Components Version:        3.6.0

Serverless.yaml

service: projectName

frameworkVersion: '2'

plugins:
  - serverless-vpc-discovery
  - serverless-aws-alias

custom: ${file(../config-serverless/config.yml)}

package:
  individually: true
  exclude:
    - ".*/**"

provider:
  name: aws
  runtime: nodejs12.x
  lambdaHashingVersion: 20201221

  stage: ${self:custom.stage}
  region: ${self:custom.region}

functions:
  function1:
    handler: lambdas/function1/function1.function1
    layers:
      - {Ref: CommonLambdaLayer}
    package:
      include:
        - lambdas/elasticStatus/**

layers:
  common:
    path: layers/common
    name: common-${self:provider.stage}
    description: A common wrapper for all the helios code
    package:
      include:
        - layers/common/**

This may be related to this issue: #181 and #186

I also applied the fix provided by @Enase in here #186 (comment) but that also did not help.

One of issue tagged here mention here about roles, and also fix provided by @Enase is also for roles. But I am not mentioning role at function level or at provider level. Is that mandatory?

@Enase
Copy link
Contributor

Enase commented Feb 4, 2021

what is the command you run?

@Abhijith-Nagaraja
Copy link
Author

Abhijith-Nagaraja commented Feb 4, 2021

@Enase : sls deploy

@Abhijith-Nagaraja
Copy link
Author

@Enase : Update. I ran with SLS_DEBUG on and set the level to verbose.... so here is the updated error report

Serverless Error ---------------------------------------
 
  ServerlessError: Export 'projectName-stageName-ServerlessAliasReference' does not exist.
      at /var/jenkins/workspace/projectName/node_modules/serverless/lib/plugins/aws/provider.js:1406:27
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

@Enase
Copy link
Contributor

Enase commented Feb 4, 2021

Unfortunately I cannot help with it.

Abhijith-Nagaraja added a commit to Abhijith-Nagaraja/serverless-aws-alias that referenced this issue Feb 5, 2021
This is an inspiration from the fix that @Enase provided long back and not merged.
Tested in my local setup and works.

Fixes issue serverless-heaven#186 and serverless-heaven#200
Abhijith-Nagaraja added a commit to Abhijith-Nagaraja/serverless-aws-alias that referenced this issue Feb 5, 2021
This is an inspiration from the fix that @Enase provided long back and not merged.
Tested in my local setup and works.

Fixes issue serverless-heaven#186 and serverless-heaven#200
@Abhijith-Nagaraja
Copy link
Author

Abhijith-Nagaraja commented Feb 5, 2021

@Enase: Created a PR for this #201 by looking at your serverless-aws-alias-fixed and it works. I am able to create alias successfully. I don't know why your PR is pending in such long time and it is little out of date in terms of dependencies.

So hopefully this can get merged quickly so that we can drop our patch works

@Enase
Copy link
Contributor

Enase commented Feb 5, 2021

@Abhijith-Nagaraja repository owner doesn't replay more then a year. I've created serverless-aws-alias-fixed by request of community members.

PS: I don't think that it's a good choice to use this plugin if you start a new project. Consider to use stages without aliases.

@clarkritchie
Copy link

@Enase Awesome, checking that out now. 👍👍👍

@amanbedi23
Copy link

amanbedi23 commented Mar 19, 2021

remove - serverless-aws-alias plugin and dont install that plugin.

It looks like the newer versions of serverless don't require you to use that to define stages.
I tried it and it fixed the problem.

@kunalfleethawks
Copy link

kunalfleethawks commented Jun 9, 2021

Those are still struggling to get this working in 2021:

I found alternative solution

I used this plugin: https://github.com/davidgf/serverless-plugin-canary-deployments

and use this in your yml file

plugins:
  - serverless-plugin-canary-deployments
  
functions:
  hello:
    handler: handler.hello
    events:
      - http: GET hello
    deploymentSettings:
      type: AllAtOnce
      alias: sampleAlias

@chandywerks
Copy link

I'm also encountering this issue.

@muqadar-ali
Copy link

  • serverless-plugin-canary-deployments

This works but it will throw log group alias already exist error when deploying to existing stage with same alias. Like if you have deployed it on all the following stages: dev, stg, prd and you are again deploying a change on dev.

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

No branches or pull requests

7 participants