Coder Social home page Coder Social logo

Comments (5)

LevelbossMike avatar LevelbossMike commented on July 30, 2024

Hi and sorry to hear that you are experiencing issues with s3-index. Based on your description it's hard to tell for me what's going wrong exactly. Can you provide more detail about your deployment setup?

It looks like the deployment fails on the activate step. Are you tagging the revision with a plugin? Do you have an automatic activation of a revision on deploy setup in pipeline options?

Are you running into the same error when you deploy a revision and activate the revision in a second step?

from ember-cli-deploy-s3-index.

erkie avatar erkie commented on July 30, 2024

Ah sorry. So I just run ember deploy production.

These are my deploy plugins. We're uploading to DigitalOcean spaces. The problem occurs on the copyObject call of the activate step of ember-cli-deploy-s3-index.

{
    "ember-cli-deploy": "1.0.0",
    "ember-cli-deploy-build": "1.0.0",
    "ember-cli-deploy-display-revisions": "1.0.0",
    "ember-cli-deploy-manifest": "1.1.0",
    "ember-cli-deploy-revision-data": "1.0.0",
    "ember-cli-deploy-s3": "git+https://github.com/ember-cli-deploy/ember-cli-deploy-s3.git#71a84ad4735e984b7235c8bbdf3e3fa519275922",
    "ember-cli-deploy-s3-index": "1.1.0",
    "ember-cli-deploy-webhooks": "1.0.0-beta.1"
}

This is my deploy.js

const fs = require("fs");

const VALID_DEPLOY_TARGETS = [ //update these to match what you call your deployment targets
  'development',
  'staging',
  'production'
];

module.exports = function(deployTarget) {
  var ENV = {
    build: {}
  };

  ENV["manifest"] = {
    // In ember-cli-deploy-manifest 1.1.0 they added the "fileIgnorePattern"
    // this let's ignore the file "sw.js" in the deploy manifest.txt
    // if sw.js would appear there, sw.js would never be updated
    // causing the service worker to not update properly on new deploys
    fileIgnorePattern: "sw.js"
  }

  if (VALID_DEPLOY_TARGETS.indexOf(deployTarget) === -1) {
    throw new Error('Invalid deployTarget ' + deployTarget);
  }

  if (deployTarget === 'development') {
    ENV.build.environment = 'development';
    ENV.plugins = ['build'];
  }

  if (deployTarget === 'staging') {
    ENV.build.environment = 'staging';
    ENV.s3 = readBucketConfig(deployTarget);
    ENV['s3-index'] = readBucketConfig(deployTarget);
    ENV['s3-index'].allowOverwrite = true;
    ENV.pipeline = {
      activateOnDeploy: true
    };
    ENV.ping = {
      urls: [
        "http://localhost/_system/perform-cache-bust"
      ]
    }
  }

  if (deployTarget === 'production') {
    ENV.build.environment = 'production';
    ENV.s3 = readBucketConfig(deployTarget);
    ENV['s3-index'] = readBucketConfig(deployTarget);
    ENV['s3-index'].allowOverwrite = true; // I see no reason not to allow overwrite here
    ENV.pipeline = {
      activateOnDeploy: true
    };
    ENV.webhooks = {
      services: {
        cache1: cacheBust()
      }
    };
  }

  return ENV;
}

function cacheBust() {
  return {
    url: "https://production/_system/perform-cache-bust",
    method: "GET",
    headers: {},
    body() { return {}; },
    didActivate: true
  };
}

function readBucketConfig(deployTarget) {
  return JSON.parse(fs.readFileSync(`hosting/${deployTarget}/digitalocean.json`));
}

I tried running ember deploy production --activate and it failed with the same error.

~/feederco/frontend (master) ember deploy production --activate
WARNING: [ember-intl] `locales` is obsolete and can be removed from config/ember-intl.js.
WARNING: [ember-intl] `disablePolyfill` is obsolete and can be removed from config/ember-intl.js.
WARNING: [ember-intl] `autoPolyfill` is obsolete and can be removed from config/ember-intl.js.
WARNING: Option "nodeWorker" is deprecated since [email protected]. Please use "workerType" instead.
cleaning up...
Deploying [================🚀 ------] 76% [plugin: s3-index -> activate]InvalidArgument: null
InvalidArgument: null
    at Request.extractError (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/services/s3.js:835:35)
    at Request.callListeners (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
    at callNextListener (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
    at IncomingMessage.onEnd (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/event_listeners.js:307:13)
    at IncomingMessage.emit (events.js:322:22)
    at IncomingMessage.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1187:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Pipeline aborted
ember deploy production --activate  49.27s user 10.40s system 122% cpu 48.669 total

from ember-cli-deploy-s3-index.

LevelbossMike avatar LevelbossMike commented on July 30, 2024

Can you try to turn off automatic activation of the deployed revision please? you are turning that on via the pipeline options for the production environment. Just for debugging purposes - to make sure we aren't running into a race condition for some reason.

from ember-cli-deploy-s3-index.

erkie avatar erkie commented on July 30, 2024

Same error... Removing the encodeURIComponent on the previously mentioned line fixes it tho.

aeaee4ec -v
Registering hook -> configure[build]
Registering hook -> configure[display-revisions]
Registering hook -> configure[manifest]
Registering hook -> configure[revision-data]
Registering hook -> configure[s3]
Registering hook -> configure[s3-index]
Registering hook -> fetchInitialRevisions[s3-index]
Registering hook -> activate[s3-index]
Registering hook -> fetchRevisions[s3-index]
Registering hook -> didFail[webhooks]
Registering hook -> configure[webhooks]
Registering hook -> setup[webhooks]
Registering hook -> willActivate[webhooks]
Registering hook -> activate[webhooks]
Registering hook -> fetchRevisions[webhooks]
Registering hook -> didActivate[webhooks]
Registering hook -> teardown[webhooks]
Executing pipeline
|
+- configure
|  |
|  +- build
|    - validating config
|    - Missing config: `outputPath`, using default: `tmp/deploy-dist`
|    - config ok
|  |
|  +- display-revisions
|    - validating config
|    - Missing config: `amount`, using default: `[Function]`
|    - Missing config: `revisions`, using default: `[Function]`
|    - config ok
|  |
|  +- manifest
|    - validating config
|    - Missing config: `filePattern`, using default: `**/*.{js,css,png,gif,ico,jpg,map,xml,txt,svg,swf,eot,ttf,woff,woff2}`
|    - Missing config: `manifestPath`, using default: `manifest.txt`
|    - Missing config: `distDir`, using default: `[Function]`
|    - Missing config: `distFiles`, using default: `[Function]`
|    - config ok
|  |
|  +- revision-data
|    - validating config
|    - Missing config: `type`, using default: `file-hash`
|    - Missing config: `separator`, using default: `+`
|    - Missing config: `filePattern`, using default: `index.html`
|    - Missing config: `versionFile`, using default: `package.json`
|    - Missing config: `distDir`, using default: `[Function]`
|    - Missing config: `distFiles`, using default: `[Function]`
|    - Missing config: `scm`, using default: `[Function]`
|    - config ok
|  |
|  +- s3
|    - validating config
|    - Missing config: `filePattern`, using default: `**/*.{js,css,png,gif,ico,jpg,map,xml,txt,svg,swf,eot,ttf,woff,woff2,otf,wasm}`
|    - Missing config: `fileIgnorePattern`, using default: `null`
|    - Missing config: `profile`, using default: ``
|    - Missing config: `acl`, using default: `public-read`
|    - Missing config: `cacheControl`, using default: `max-age=63072000, public`
|    - Missing config: `expires`, using default: `Tue Jan 01 2030 01:00:00 GMT+0100 (Central European Standard Time)`
|    - Missing config: `dotFolders`, using default: `false`
|    - Missing config: `batchSize`, using default: `0`
|    - Missing config: `defaultMimeType`, using default: `application/octet-stream`
|    - Missing config: `distDir`, using default: `[Function]`
|    - Missing config: `distFiles`, using default: `[Function]`
|    - Missing config: `gzippedFiles`, using default: `[Function]`
|    - Missing config: `brotliCompressedFiles`, using default: `[Function]`
|    - Missing config: `manifestPath`, using default: `[Function]`
|    - Missing config: `uploadClient`, using default: `[Function]`
|    - Missing config: `s3Client`, using default: `[Function]`
|    - config ok
|  |
|  +- s3-index
|    - validating config
|    - Missing config: `filePattern`, using default: `index.html`
|    - Missing config: `acl`, using default: `public-read`
|    - Missing config: `cacheControl`, using default: `max-age=0, no-cache`
|    - Missing config: `distDir`, using default: `[Function]`
|    - Missing config: `revisionKey`, using default: `[Function]`
|    - Missing config: `s3Client`, using default: `[Function]`
|    - Missing config: `gzippedFiles`, using default: `[Function]`
|    - config ok
|  |
|  +- webhooks
|    - validating config
|    - Missing config: `configuredServices`, using default: `[Function]`
|    - Missing config: `httpClient`, using default: `[Function]`
|    - config ok
|
+- setup
|  |
|  +- webhooks
|
+- fetchInitialRevisions
|  |
|  +- s3-index
|    - Using endpoint from config
|
+- willActivate
|  |
|  +- webhooks
|
+- activate
|  |
|  +- s3-index
|    - preparing to activate `04a579475d1340cd48b2e422aeaee4ec`
|    - Using endpoint from config
|
+- didFail
InvalidArgument: null
InvalidArgument: null
    at Request.extractError (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/services/s3.js:835:35)
    at Request.callListeners (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/erik/feederco/frontend/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
    at callNextListener (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
    at IncomingMessage.onEnd (/Users/erik/feederco/frontend/node_modules/aws-sdk/lib/event_listeners.js:307:13)
    at IncomingMessage.emit (events.js:322:22)
    at IncomingMessage.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1187:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
|  |
|  +- webhooks
|
Pipeline aborted

from ember-cli-deploy-s3-index.

LevelbossMike avatar LevelbossMike commented on July 30, 2024

ok - I'd be surprised if encodeUriComponent would be the problem actually causing this - just given the fact that this has been in from the beginning of this addon afaik.

I won't have the time to dive into this for the next few days. If you want to look into this before that I suggest to debug into s3.js and figure out why https://github.com/aws/aws-sdk-js/blob/v2.667.0/lib/services/s3.js#L835 is throwing.

I suppose this is something weird happening with digital ocean spaces but I'd have to try this service out for myself before being sure.

from ember-cli-deploy-s3-index.

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.