Comments (15)
Hi @DerMambo,
Thanks for the bug report. I can confirm that the problem also exists in the example-app when I add spiderable so its definitely some kind of a conflict.
The 15 secs is the REQUEST_TIMEOUT that spiderable uses when running phantomjs. So for some reason the subscribe call running under phantomjs is causing the script to run longer than 15 secs and it gets aborted.
I was also able to get spiderable to work by commenting out the subscribe as you mentioned. It also works if you wrap the subscribe in a Meteor.setTimeout call. I suspect this accomplishes the same thing as commenting it out as the phantomjs process probably finishes before the timeout fires. On my local machine, a timeout of 500 ms worked; using a shorter time didn't.
I'll keep working on figuring this out but for now the simplest workarounds seem to be to either add the setTimeout or comment it out as you do and perform the subscribe yourself in your application's client. (The subscribe is necessary in order to check user roles client-side.)
from meteor-roles.
Took a while to track this down. The spiderable package does a check for "_allSubscriptionsReady()" before rendering a page. Because I was doing a straight 'return' in the server-side publish function when the user had not signed in rather than returning an empty cursor, the subscription was never marked as ready on the initial page.
I've updated the package to explicitly stop the package and spiderable is working for me in the example app now.
You can see this in action by running curl against the example app up on meteor.com:
> curl http://roles-example.meteor.com/
> curl http://roles-example.meteor.com/?_escaped_fragment_=
Please try out v1.0.3 and confirm that this resolves the issue you were seeing. Running, 'mrt update', in your project folder will pull the latest version.
from meteor-roles.
It now works on my local machine!
I still can't get it to work on my server, but i guess this is not a problem with your package anymore. I'll always get this in the logs:
spiderable: phantomjs failed: { [Error: Command failed: Can't open '/dev/stdin'
] killed: false, code: 255, signal: null }
stderr: Can't open '/dev/stdin'
Thx for your fast update, i really like your work!
from meteor-roles.
Thanks!
What's the server OS that you're running? The spiderable package is hard-coded to rely on /dev/stdin existing and unfortunately there is no such thing on windows so that may be the cause. If its a flavor of linux then it should work and there's something else strange going on...
from meteor-roles.
I am running Ubuntu 12.04 LTS. I also found /dev/stdin on the server.
On a "ls -al" in /dev it shows:
lrwxrwxrwx 1 root root 15 Dec 13 22:36 stdin -> /proc/self/fd/0
I am also running the meteor process as root (only because i want to be sure that there are no problems with permissions). I won't give up :-)
from meteor-roles.
It is working now. I did install phantomjs 1.8.2 via npm. I removed phantomjs and reinstalled it from http://phantomjs.org/download.html directly. Now it is working, thanks again for your help!
from meteor-roles.
Nice! Glad you could get it working. Wonder why the npm phantomjs would cause issues...
If you have time, it would be helpful to see if it is reproducible.
from meteor-roles.
This is still happening on the latest release. I get a
spiderable: phantomjs failed: { [Error: Command failed: Can't open '/dev/stdin'
] killed: false, code: 255, signal: null }
from meteor-roles.
Hi @andreioprisan,
It seems to be working using the mini-pages example code deployed to meteor.com. You can confirm this by executing these two commands from the terminal:
> curl http://roles.meteor.com/
> curl http://roles.meteor.com/?_escaped_fragment_=
Can you try the mini-pages example app and see if that works for you? If not, please try re-installing phantomjs as @DerMambo did before and see if that works.
fyi, I'm going off grid for a few days while traveling so won't be able to check in for a bit. But I'll check back in towards the end of this week.
from meteor-roles.
It works if you install phantomjs via their site binary, not npm. The latest 1.9.1 works just fine. I also had to link /dev/stdin to /dev/fd/0 because it kept SIGTERMing without a reason.
from meteor-roles.
@andreioprisan - What do you mean by linking in this case? How do you set it up?
from meteor-roles.
@datacarl Are you also seeing this problem if you use phantomjs 1.9.1?
from meteor-roles.
Yepp. Installing with npm gives me the following error:
spiderable: phantomjs failed: { [Error: Command failed: Can't open '/dev/stdin'
] killed: false, code: 255, signal: null }
stderr: Can't open '/dev/stdin'
Installing from http://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 gives me:
spiderable: phantomjs failed: { [Error: Command failed: ] killed: true, code: null, signal: 'SIGTERM' }
stderr:
I'm not running meteor as root if that makes any difference.
from meteor-roles.
I just realised that I posted in the meteor-roles repo. Sorry, I dont have meteor-roles installed, just got the same error .
from meteor-roles.
OK, thank you for letting me know it's a general Spiderable/phantomjs issue. I'll go ahead and leave this ticket as closed for now. If someone runs across an issue specific to meteor-roles + Spiderable, please comment and/or re-open.
@datacarl One thing you may want to try is removing the npm-installed version of phantomjs and using the latest binary. Other people on this thread have apparently had success doing it that way. Also, for what its worth, I haven't seen this issue running on CentOS so perhaps it is related to how Ubuntu handles stdin...
from meteor-roles.
Related Issues (20)
- How to run migration script from V1 -> V3 HOT 3
- Exception on subscription: $in needs an array.
- Support new Meteor async API (Meteor 2.8+) HOT 2
- Defaut publication uses only user._id, but no index is created on that field only HOT 2
- cannot add data into role-assignment HOT 3
- Meteor.roleAssignment, error: Property 'roleAssignment' does not exist on type 'typeof Meteor'. HOT 5
- Weird issue with role-assignement.. HOT 2
- Upgrading from 3.4.0 to 3.5.0 introduces 6x node "UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'isCalledFromAsync' of undefined" warnings. HOT 1
- TypeError: Cannot set property 'isCalledFromAsync' of undefined ... HOT 4
- Improve community standards HOT 1
- Add code quality tools HOT 2
- Add selector to Roles.getUsersInRole HOT 2
- forwardMigrate2 tries to drop unset index HOT 1
- Add new function to change scope of existing role assignment HOT 1
- addRolesToParent -> Reset inheritance as unwanted roles may still be connected HOT 1
- Get a list of users with a scope HOT 13
- api docs still show v.3.4.0 in upper right corner HOT 1
- Not async? HOT 3
- Dependency on old [email protected] (need v3.0.0-rc300.1) HOT 3
- Roles.createRole is not a function (alanning:[email protected]) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-roles.