-
Notifications
You must be signed in to change notification settings - Fork 7
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
500 Error: Unable to open Image (octet-stream). Image in sub-folder, fails w/ Query Params #20
Comments
Update: I tried with an image in the root of the bucket and it works! Great! However, for my use-case, it'd be best if I could pull from a sub-directory in the bucket. It's probably something in |
hey @warrenmcquinn! thanks for opening an issue. @nicholasgubbins and i are pretty busy right now, so can't give you an exact date when we'll get to this one. if you have any ideas feel free to post to this issue or open a PR and we'll take a look. |
Hi, I have been dealing with a similar issue in another project and solved it by using the resultant S3 image inside the getObject() callback function instead of using .createReadStream(). function gmCreator(asset, bucket, resize_options) {
// function to create a GM process
return new Promise((resolve, reject) => {
try {
s3.getObject({ Bucket: bucket, Key: asset }, (err, data) => {
if (err) return reject(err);
const func = gm(data.Body);
...
return resolve(func);
});
} catch (err) {
return reject({ statusCode: 500, body: `{"message":"${err.message}"}` });
}
});
}
function uploadToS3(destination, bucket, mime_type, storage_class, gm) {
return new Promise((resolve, reject) => {
try {
...
gm.stream((err, stdout, stderr) => {
...
});
} catch (err) {
return reject({ statusCode: 500, body: `{"message":"${err.message}"}` });
}
});
} Hope this helps! |
var params = { --- Put ContentType of file |
This is a Bug Report
Description
For bug reports:
When I make an HTTP request to the serverless url, to resize an image in a sub-folder, with query parameters, I get a 500 error:
When I don't use query params, the image downloads right away.
What was the config you used?
serverless.yml with my personal bucket.
I've set the Binary type on the gateway to /.
What stacktrace or error message from your provider did you see?
I set up APIGateway logs in CloudWatch using the guide posted in Query Param - failed #17
Similar or dependent issues:
Additional Data
Here's the CloudWatch log:
The text was updated successfully, but these errors were encountered: