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

Missing required key 'Bucket' in params. #92

Closed
trainbolt opened this issue May 13, 2015 · 4 comments
Closed

Missing required key 'Bucket' in params. #92

trainbolt opened this issue May 13, 2015 · 4 comments

Comments

@trainbolt
Copy link

I am getting this error when running gulp now after this integration and I can't seem to locate where it's gone wrong.

/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/param_validator.js:23
throw this.errors[0];
                       ^
MissingRequiredParameter: Missing required key 'Bucket' in params
at fail (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/param_validator.js:118:37)
at validateStructure (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/param_validator.js:37:14)
at validateMember (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/param_validator.js:64:21)
at validate (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/param_validator.js:12:10)
at Request.VALIDATE_PARAMETERS (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/event_listeners.js:88:32)
at Request.callListeners (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/sequential_executor.js:100:18)
at callNextListener (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/sequential_executor.js:90:14)
at /site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/event_listeners.js:75:9
at finish (/site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/config.js:228:7)
at /site/web/app/themes/sage/node_modules/gulp-awspublish/node_modules/aws-sdk/lib/config.js:268:9

Here's the gulp/build portion of my gulpfile:

var RevAll = require('gulp-rev-all');
var awspublish = require('gulp-awspublish');
var cloudfront = require("gulp-cloudfront");

var aws = {
    "key": "XXXXXXXXXXXXXXXXXXXX",
    "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
    "bucket": "XXXXXXXX",
    "region": "us-standard",
    "distributionId": "XXXXXXXXXXXX"
};

var publisher = awspublish.create(aws);
var headers = {'Cache-Control': 'max-age=315360000, no-transform, public'};

gulp.task('build', function(callback) {
    runSequence('styles',
                'scripts',
                ['fonts', 'images'],
                callback);
});

gulp.task('default', ['clean'], function() {
    gulp.start('build', function(){
        var revAll = new RevAll();
        gulp.src(path.dist + '**')
            .pipe(revAll.revision())
            .pipe(awspublish.gzip())
            .pipe(publisher.publish(headers))
            .pipe(publisher.cache())
            .pipe(awspublish.reporter())
            .pipe(cloudfront(aws));
    });
});

Everything runs perfectly fine without this.

@trainbolt
Copy link
Author

BTW, when I log the params in the param_validator.js I get something like this:

{ Key: 'fonts/FontAwesome.7d8d594e.otf' }

My guess is that somehow that aws object is not getting through?

@smysnk
Copy link
Owner

smysnk commented May 13, 2015

As per gulp-awsplugin docs it is expecting the credentials in format:
{
"params": {
"Bucket": "..."
},
"accessKeyId": "...",
"secretAccessKey": "..."
}

I am not sure if it was always like this but the gulp-rev-all documentation needs to be updated.

@trainbolt
Copy link
Author

Thanks. I actually had just figured that out as well. They need to be updated for sure. That aws object is not formatted correctly for this.

Also, there's no reference here at all about an upload path... which I'm also currently unsuccessfully implementing.

@smysnk
Copy link
Owner

smysnk commented May 13, 2015

For upload path check out their example here:
https://www.npmjs.com/package/gulp-awspublish#rename-file-directory

I would argue this is unrelated to gulp-rev-all plugin besides the example code snippet needing updating.

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

2 participants