Skip to content

AWS - Incorrect path seperate used when defining package path. #5934

Closed

Description

@maxplezzel

This is a Bug Report

Description

Incorrect path separator used when determining where the deployment artefact is located in AWS deployment.

  • What went wrong?
    When setting the package path the wrong path seperate was being used for MacOS, resulting in the incorrect path being used to upload artefacts to S3.

  • What did you expect should have happened?
    Correct path seperate to be used based upon OS.

  • What was the config you used?
    Standard

  • What stacktrace or error message from your provider did you see?

Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...

  Error --------------------------------------------------

  ENOENT: no such file or directory, stat './server/.serverless/.serverless/fishcare-cms-server.zip'

     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 -----------------------------
     OS:                     darwin
     Node Version:           9.3.0
     Serverless Version:     1.39.0

Solution

Change:

  • File: serverless/lib/plugins/aws/package/lib/saveServiceState.js
  • Line: 35
  • To: packageRef.artifact.substr(packageRef.artifact.lastIndexOf(path.sep) + 1)

I would make the change myself but haven't contributed before and don't have time right now to meet contribution requirements.

Activity

  1. julienseverin commented on Mar 17, 2019

    @julienseverin

    Got the same issue, had to rollback to 1.38.0

  2. ClementKerneur commented on Mar 17, 2019

    @ClementKerneur

    Same problem, i rollback to 1.38.0 also !!!

  3. chrisanderss0n commented on Mar 17, 2019

    @chrisanderss0n

    I will fix, PR coming up.

  4. pmuens commented on Mar 18, 2019

    @pmuens
    Contributor

    Just reverted #4188 which seems to be the root cause. Patch release should be out in ~30 minutes...

  5. decebal commented on Aug 16, 2019

    @decebal

    Somehow this one has resurfaced in the latest versions 1.49 and 1.50, I am still on my way to test which one works.
    I rolled back to 1.38.0, but a more thorough investigation would be better, I think.

  6. deleted a comment from voidp34r on Feb 10, 2020
  7. aardrop commented on Apr 17, 2020

    @aardrop

    I'm still having this issue with version 1.66. I'm happy to roll back for now but I worry that is not sustainable, does anyone know a solution or work around?

  8. dretsa commented on Apr 27, 2020

    @dretsa

    Seems to have found it's way back into 1.66 apparently and 1.68 doesn't work for me too. I am running into the following error (PC configuration included):

    Serverless: Packaging service...
     Serverless: Excluding development dependencies...
      
       Error --------------------------------------------------
      
       Error: ENOENT: no such file or directory, open '/builds/.../node_modules/.bin/image-size'
      
          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:              12.14.1
          Framework Version:         1.68.0
          Plugin Version:            3.6.8
          SDK Version:               2.3.0
          Components Version:        2.30.2
    
  9. alphonso77 commented on Apr 28, 2020

    @alphonso77

    I was experiencing this behavior as well. I tried reverting to several versions to no avail. I dug around a little bit and I'm not sure which one of these actions fixed the problem, but here's the steps I took (windows 10, PS):

    1. Run npm list -g --depth 0 (this listed all of the packages I'd installed globally via npm, and several of them had broken dependencies)
    2. uninstall all npm packages (including serverless): npm uninstall -g <package-name>
    3. choco upgrade serverless
    4. run sls deploy again, works
  10. cknuteson-firstlook commented on May 5, 2020

    @cknuteson-firstlook

    Chiming in to say this is happening with 1.69.0

    Serverless: Compiling with Typescript...
    Serverless: Using local tsconfig.json
    Serverless: Typescript compiled.
    Serverless: Packaging service...
    Serverless: Excluding development dependencies...
     
      Error --------------------------------------------------
     
      Error: ENOENT: no such file or directory, stat '/Users/<me>/<project>/packages/backend/.build/node_modules/.bin/tsc'
     
         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:          darwin
         Node Version:              12.16.1
         Framework Version:         1.69.0 (standalone)
         Plugin Version:            3.6.8
         SDK Version:               2.3.0
         Components Version:        2.30.2
    
  11. mithundas79 commented on Dec 3, 2020

    @mithundas79

    This is an issue when i am trying to use the serverless express template.

    C:\Users\LENOVO\Documents\Official\Projects\OCPP-Client\bluedot-cpms-service\ocpp_express>serverless create --template-url https://github.com/serverless/components/tree/master/templates/express
    Serverless: Generating boilerplate...
    Serverless: Downloading and installing "templates\express"...
    (node:22640) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
    
      Serverless Error ---------------------------------------
    
      Error: ENOENT: no such file or directory, stat 'C:\Users\LENOVO\AppData\Local\Temp\components\templates\express'
    
      Get Support --------------------------------------------
         Docs:          docs.serverless.com
         Bugs:          github.com/serverless/serverless/issues
         Issues:        forum.serverless.com
    
      Your Environment Information ---------------------------
         Operating System:          win32
         Node Version:              13.9.0
         Framework Version:         1.78.1
         Plugin Version:            3.7.0
         SDK Version:               2.3.1
         Components Version:        2.34.5
    
  12. bcraft commented on Dec 4, 2020

    @bcraft

    picked this exact issue up again today on 2.12, replicated things manually and cannot repeat the error but sls package wont go through.

  13. wmlutz commented on Dec 12, 2020

    @wmlutz

    @bcraft I just tried to get things going today on 2.15.0 and ran into the same problem.

  14. mithundas79 commented on Dec 12, 2020

    @mithundas79

    Ok problem is https://github.com/serverless/components/tree/master/templates/express NOT FOUND :(

    I hv not taken the template, rather i used the simplier serverless-http method and this is running for me. So not sure my issue is related to anything above.

  15. brognilucas commented on Apr 21, 2021

    @brognilucas

    Having the same problem here. When I deploy from my local environment works though.

  16. crsepulv commented on Apr 19, 2023

    @crsepulv

    in my case the problem is

    • serverless-plugin-typescript
      if I remove it, deploys well.
  17. odiazjs commented on May 31, 2024

    @odiazjs

    @crsepulv thanks, I believe the issue lies in that when you have a custom tsconfig.json and you custom compile the typescript project, while also using the serverless-plugin-typescript which I believe already does that automatically under the hood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions