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

error while accessing aws s3 bucket #7282

Closed
quant-daddy opened this issue Jun 13, 2016 · 1 comment
Closed

error while accessing aws s3 bucket #7282

quant-daddy opened this issue Jun 13, 2016 · 1 comment
Labels
invalid Issues and PRs that are invalid.

Comments

@quant-daddy
Copy link

quant-daddy commented Jun 13, 2016

  • v6.2.0:
  • Linux surajPC 4.2.0-36-generic rename node.js -> io.js #42~14.04.1-Ubuntu SMP Fri May 13 17:27:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux:
  • Subsystem:

I'm using the code below

//this code in fileA.js
var aws = require('aws-sdk'),
  http = require('http'),
  fs = require('fs'),
  path = require('path'),
  express = require('express');

var app = new express();

var config_path = path.join(__dirname, '../auth.json');

aws.config.loadFromPath(config_path);
var s3 = new aws.S3();

app.get('/buckets', function (req, res) {
  s3.listBuckets(function (err, data) {
    res.json(data);
  });
});

module.exports = app;

//Then I call this module in another file
var app = require('./fileA'),
  http = require('http');

http.createServer(app).listen(3000, function(){
  console.log('Server listening on port 3000');
});

Once I access the localhost:3000/buckets, I get the following error:

TypeError: Cannot read property 'length' of null
    at Object.AWS.util.buffer.concat (/home/suraj/Desktop/server/node_modules/aws-sdk/lib/util.js:116:29)
    at Request.HTTP_DONE (/home/suraj/Desktop/server/node_modules/aws-sdk/lib/event_listeners.js:214:36)
    at Request.callListeners (/home/suraj/Desktop/server/node_modules/aws-sdk/lib/sequential_executor.js:132:20)
    at Request.emit (/home/suraj/Desktop/server/node_modules/aws-sdk/lib/sequential_executor.js:100:10)
    at Request.emitEvent (/home/suraj/Desktop/server/node_modules/aws-sdk/lib/request.js:408:10)
    at IncomingMessage.onEnd (/home/suraj/Desktop/server/node_modules/aws-sdk/lib/event_listeners.js:184:26)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:926:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)

I'm not sure if this has anything to do with the warning I get when I npm install aws -sdk

npm WARN amazons3@0.0.0 No repository field.
npm WARN amazons3@0.0.0 license should be a valid SPDX license expression
@rvagg
Copy link
Member

rvagg commented Jun 13, 2016

sorry @skk2142, we can't do support for packages in npm here, you'll have to take your query over to the aws-sdk package: https://github.com/aws/aws-sdk-js

@rvagg rvagg closed this as completed Jun 13, 2016
@ChALkeR ChALkeR added the invalid Issues and PRs that are invalid. label Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

3 participants