Giter VIP home page Giter VIP logo

Comments (20)

Nemo64 avatar Nemo64 commented on September 27, 2024 1

@nibynool a missing leading slash seems to be the issue 👍

from serverless-s3-sync.

PraveenAsh avatar PraveenAsh commented on September 27, 2024 1

@nibynool works. I have verified it. Good to merge I guess.

Close the issue on review from @Nemo64.
@nibynool @k1LoW thanks for the support.

from serverless-s3-sync.

Nemo64 avatar Nemo64 commented on September 27, 2024 1

I can confirm, the bucket-prefix-slashes branch fixes it.

from serverless-s3-sync.

k1LoW avatar k1LoW commented on September 27, 2024

Hi @PraveenAsh .

  • Could you show me serverless.yml (s3Sync: ) ?
  • What is the latest version that works in your environment? ( 1.7.2 -> OK, 1.7.3 -> NG? )

from serverless-s3-sync.

PraveenAsh avatar PraveenAsh commented on September 27, 2024

serversless.yml :

 s3Sync:
    - bucketName: ${self:custom.siteName}
      bucketPrefix: ${self:custom.stage}
      localDir: static
      params: 
        - randomname.html:
            CacheControl: 'no-cache'

The custom variables exist but don't get picked. But the credentials exist in the environment with aws prefix.

The latest that failed was v1.10.2 but works fine in v1.7.2
OS : Catalina, MacOS

from serverless-s3-sync.

Nemo64 avatar Nemo64 commented on September 27, 2024

I probably have the same issue. If I remove params it syncs assets fine but without metadata of course.

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

@PraveenAsh it would be great to know what the earliest version is that fails and the latest version that works. It helps to narrow down where a code change has had an unexpected impact. At the moment the range you have provided is "somewhere between 1.7.2 and 1.10.2".

1.7.2 was released over 1 year ago, there have been 8 versions released since then, and 1.10.2 was released less than 3 weeks ago.

Are you creating the bucket in your resources?
Can you verify the bucket is created on AWS, is the name of the bucket as expected?

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

@Nemo64 it sounds like you have a different issue. Please create a new issue for it, but I would suggest checking out #41 as I think that could be the issue you are facing (there's a fix at the end of that issue)

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

As a side note to this. I have no formal involvement in this project, but I am happy to assist where I can. If @k1LoW overrides anything I say then please honour his wishes above mine.

from serverless-s3-sync.

Nemo64 avatar Nemo64 commented on September 27, 2024

@nibynool i'm not sure, i get the same error as @PraveenAsh :

S3 Sync: Syncing directories and S3 prefixes...
.
S3 Sync: Synced.
S3 Sync: Syncing metadata...
[{}]
.
S3 Sync: Synced metadata.
 
  No Such Bucket -----------------------------------------
 
  NoSuchBucket: The specified bucket does not exist
      at Request.extractError (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/services/s3.js:816:35)
      at Request.callListeners (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
      at Request.emit (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
      at Request.emit (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:683:14)
      at Request.transition (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:22:10)
      at AcceptorStateMachine.runTo (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/state_machine.js:14:12)
      at /Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/state_machine.js:26:10
      at Request.<anonymous> (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:38:9)
      at Request.<anonymous> (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:685:12)
      at Request.callListeners (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
      at Request.emit (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
      at Request.emit (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:683:14)
      at Request.transition (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:22:10)
      at AcceptorStateMachine.runTo (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/state_machine.js:14:12)
      at /Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/state_machine.js:26:10
      at Request.<anonymous> (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:38:9)
      at Request.<anonymous> (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/request.js:685:12)
      at Request.callListeners (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
      at callNextListener (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
      at IncomingMessage.onEnd (/Users/marco/.config/yarn/global/node_modules/aws-sdk/lib/event_listeners.js:307:13)
      at IncomingMessage.emit (events.js:317:22)
      at IncomingMessage.EventEmitter.emit (domain.js:483:12)
      at endReadableNT (_stream_readable.js:1215:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)

And I have a very similar setup:

custom:
  s3Sync:
    - bucketName: '${self:service}-${self:provider.stage}-assets'
      localDir: 'public/build/'
      bucketPrefix: 'build/'
      params:
        - "**/????????????????????.*": # hashed webpack resources (which contain exactly 20 hex characters)
            CacheControl: 'public, max-age=31536000, immutable'

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

Ahhh, thanks for the extra context @Nemo64. This should be resolved by PR #45 (there was a bug in my code that went into 1.10.2). #41 (comment) should allow you to work around the problem until it is merged and tagged. If it works can you please confirm in this thread so there is some additional verification it solves the issues experienced?

@PraveenAsh, with the additional context from @Nemo64, I think this may also solve your issue.

from serverless-s3-sync.

Nemo64 avatar Nemo64 commented on September 27, 2024

Nope, doesn't resolve it. It has something to do with params.
Just for fun, i used version 1.7.2, like @PraveenAsh said and (kinda) works. It doesn't update but on create it'll set metadata.
Then I went though the versions and found that 1.10.0 is the first failing version, 1.9.2 works fine.

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

The change between 1.9.2 and 1.10.0 was to add functionality to allow the update on change, so the 1.9.2 version should suffice for now.

I had some issues with 1.10.1 and added a fix for these, but in the process introduced a new bug and that became part of 1.10.2. I have created the PR #45 to fix these, and I believe the fix included the No Such Bucket issue.

I'm not sure of your level of knowledge with npm and JS, so sorry if this is obvious to you, but to get my latest version (the one the PR is created from) you would need to manually override the reference in package.json to reference the nibynool/serverless-s3-sync repository and the specific commit. Just so I don't invest too much time in this can you please confirm that you tried this?

Version 1.10.3 has just been released, this includes the changes I just mentioned. Please re-verify with the latest version (just for my peace of mind).

If this doesn't work, can you please try removing the bucketPrefix line from your config and remove the build/ from your localDir definition. If this works, then it gives me a great pointer to where the problem may be (I don't use the bucketPrefix in my config).

from serverless-s3-sync.

PraveenAsh avatar PraveenAsh commented on September 27, 2024

Deployment failing in v1.10.3 too. Back to square one. Just tested.

Same Error :

S3 Sync: Synced metadata.
 
  No Such Bucket -----------------------------------------
 
  NoSuchBucket: The specified bucket does not exist

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

I think the issue is likely related to the bucketPrefix at this point. I will try to investigate further but may not get time for a few days. If anyone else has some time to look into it, it will be in the syncMetadata function in index.js likely around line 235.

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

The current code expects the bucketPrefix to be prepended with a / and not have a trailing one.

Can you try changing the slash from the end of the prefix to the start of it. I will investigate adding better detection for leading and trailing slashes in the prefix if someone doesn't beat me to it.

from serverless-s3-sync.

nibynool avatar nibynool commented on September 27, 2024

@PraveenAsh and @Nemo64, I have created PR #50 to fix this. Can you please update your package.json to contain "serverless-s3-sync": "github:nibynool/serverless-s3-sync#bucket-prefix-slashes" and let me know if that fixes the issue (I don't have a test project for this use case at this time).

If it doesn't fix the issue I will create a proper test case and try to resolve it. If it does fix the issue then we can ask @k1LoW to merge the PR (you will need to alter your package.json back to the release version once it has been tagged and released).

from serverless-s3-sync.

PraveenAsh avatar PraveenAsh commented on September 27, 2024

Bug fixed will most likely be available from 1.10.4 onwards(Should be coming out soon).

Closing issue. Reopen when such a time comes.

from serverless-s3-sync.

PraveenAsh avatar PraveenAsh commented on September 27, 2024

Merge the branch and give a new release.

@nibynool @k1LoW

from serverless-s3-sync.

judehunter avatar judehunter commented on September 27, 2024

I just encountered this issue with the bucket prefix option.
Can someone reopen this please?

from serverless-s3-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.