asilvas / node-image-steam

A simple, fast, and highly customizable on-the-fly image manipulation web server built atop Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsupported step in meteor

bmustata opened this issue · comments

Issue with the default connect middleware & S3 storage:

Error: Unsupported step: 
   at /node_modules/image-steam/lib/router/router.js:213:13
   at Array.map (native)
   at EventEmitter.getImageStepsFromRoute (/node_modules/image-steam/lib/router/router.js:206:21)
   at EventEmitter.p.getInfo (/node_modules/image-steam/lib/router/router.js:102:49)
   at /node_modules/image-steam/lib/http/connect.js:71:30
   at doCall (packages/meteorhacks_picker.js:140:16)

Query path:
http://localhost:3000/file-path/:/rs=w:320

Temporary solution: /node_modules/image-steam/lib/router/router.js:201

if (imageSteps.length && !imageSteps[0])
    imageSteps.splice(0, 1);
console.log(imageSteps);

Node & NPM version:

node -v
v4.5.0
npm -v
3.10.6

Any idea what's the best solution to fix this?

Hey @bmustata -- i cannot repro using the info provided. If you're saying one of the image steps is falsey, this may indicate a configuration issue.

Can you provide the configuration you're using? (Excluding storage config)

@asilvas Thank you for the quick reply. In the config, I only have the storage setting.

"image-steam": "^0.32.0"

let streamOption = {
    "storage": {
        "driver": "s3",
        "endpoint": "s3.amazonaws.com",
        "accessKey": "...",
        "secretKey": "..."
    }
}

And you're sure the above url is the one that is failing? Any other examples, or doesn't matter? This module is serving millions of requests without issue, so just trying to better understand what differs in your environment. I might experiment with node version but it'll probably be a day or two -- so the more you can diagnose the better. Feel free to issue a PR if you identify a bug.

Verified it works as expected on node 4.5.0. Please advise on what may differ in your environment or how you're making the request.

Closing. Reopen if still an issue.

I have just made a repo so we can reproduce the issue: @asilvas
https://github.com/bmustata/meteor-image-processing.

Working link:
http://localhost:3000/development-store/products_screenshots/2DEZk5QsuTNcKGp7W-7njzoi4wGGSdKfPbt-no-mans-sky-streams.jpg

Not working link:

http://localhost:3000/development-store/products_screenshots/2DEZk5QsuTNcKGp7W-7njzoi4wGGSdKfPbt-no-mans-sky-streams.jpg/:/rs=w:640

Error:
ImageStream error { [Error: Unsupported step: ]
    url: '/development-store/products_screenshots/2DEZk5QsuTNcKGp7W-7njzoi4wGGSdKfPbt-no-mans-sky-streams.jpg/://rs=w:640' }

Appears to be a conflict with meteor. I'll try to find the time in the next couple days, but would appreciate you identifying the culprit if you can.

Tks for reopening the issue.

How to debug the issue:

Meteor.startup(function () {

    console.log("render/images startup");

    Picker.middleware(function (req, res, next) {
        console.log('Debug: url=', req.url, "originalUrl=", req.originalUrl);
        next()
    });

    var connect = new imgSteam.http.Connect(streamOption);
    Picker.middleware(connect.getHandler());

    connect.on('error', function (err) {
        console.error("ImageStream error", err);
    });
})

The issue is the req.url & res.originalUrl are both incorrect but your library is working fine.

Browsers link: file-link/:/rs=w:640
Express middleware: file-link/://rs=w:640

What is Picker?

It's meteor middleware connect. https://github.com/meteorhacks/picker

Forking your project as-is does not work at all. Installing meteor manually fails as well. If you'd like this fixed, you'll probably need to create a PR. It does appear to be a meteor specific issue, though.

I will investigate more and find the route cause, after that we will search for a solution.

This is a meteor related issue not related to node-image-steam or node. Closed.