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

Spiderable.js exception on docker #65

Open
davinderkumar opened this issue Jul 13, 2017 · 0 comments
Open

Spiderable.js exception on docker #65

davinderkumar opened this issue Jul 13, 2017 · 0 comments

Comments

@davinderkumar
Copy link

As this extension has dependency on spiderable package, which is causing the following error when I am deploying the application to Docker.
How can I remove the dependency because I want to you ongoworks:spiderable package instead of default one as ongoworks works fine in docker.

spiderable: phantomjs failed: null
stderr:
spiderable: phantomjs failed at http://www.myaddresspin.com/robots.txt: { [Error: Command failed: /usr/bin/env bash -c exec phantomjs --load-images=no --ssl-protocol=TLSv1 /dev/stdin <<'END'
var url = "http://www.myaddresspin.com/robots.txt";// 'url' is assigned to in a statement before this.
var page = require('webpage').create();

var isReady = function () {
return page.evaluate(function () {
if (typeof Meteor === 'undefined'
|| Meteor.status === undefined
|| !Meteor.status().connected) {
return false;
}
if (typeof Package === 'undefined'
|| Package.spiderable === undefined
|| Package.spiderable.Spiderable === undefined) {
return false;
}
return Package.spiderable.Spiderable.isReady();
});
};

var dumpPageContent = function () {
var out = page.content;
out = out.replace(/<script[^>]+>(.|\n|\r)?</script\s>/ig, '');
out = out.replace('', '');
console.log(out);
};

page.open(url, function(status) {
if (status === 'fail')
phantom.exit();
});

setInterval(function() {
if (isReady()) {
dumpPageContent();
phantom.exit();
}
}, 100);
END

Can't open '/dev/stdin'
]
killed: false,
code: 255,
signal: null,
cmd: '/usr/bin/env bash -c exec phantomjs --load-images=no --ssl-protocol=TLSv1 /dev/stdin <<'END'\nvar url = "http://www.myaddresspin.com/robots.txt";// 'url' is assigned to in a statement before this.\nvar page = require('webpage').create();\n\nvar isReady = function () {\n return page.evaluate(function () {\n if (typeof Meteor === 'undefined'\n || Meteor.status === undefined\n || !Meteor.status().connected) {\n return false;\n }\n if (typeof Package === 'undefined'\n || Package.spiderable === undefined\n || Package.spiderable.Spiderable === undefined) {\n return false;\n }\n return Package.spiderable.Spiderable.isReady();\n });\n};\n\nvar dumpPageContent = function () {\n var out = page.content;\n out = out.replace(/<script[^>]+>(.|\n|\r)?<\/script\s>/ig, '');\n out = out.replace('', '');\n console.log(out);\n};\n\npage.open(url, function(status) {\n if (status === 'fail')\n phantom.exit();\n});\n\nsetInterval(function() {\n if (isReady()) {\n dumpPageContent();\n phantom.exit();\n }\n}, 100);\nEND\n' }
stderr: Can't open '/dev/stdin'

stdout:
Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.
at Object.Meteor.nodeCodeMustBeInFiber (packages/meteor.js:1075:11)
at [object Object].
.extend.get (packages/meteor.js:1087:12)
at [object Object].RouteController.lookupOption (packages/iron_router.js:143:29)
at new Controller.extend.constructor (packages/iron_router.js:103:21)
at [object Object].ctor (packages/iron_core.js:144:17)
at Function.Router.createController (packages/iron_router.js:810:18)
at Function.Router.dispatch (packages/iron_router.js:1335:25)
at Object.router (packages/iron_router.js:624:12)
at next (/bundle/bundle/programs/server/npm/node_modules/meteor/webapp/node_modules/connect/lib/proto.js:174:15)
at packages/spiderable.js:171:11

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

1 participant