Code Monkey home page Code Monkey logo

Comments (15)

alanning avatar alanning commented on May 21, 2024

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.

alanning avatar alanning commented on May 21, 2024

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.

manuel-schoebel avatar manuel-schoebel commented on May 21, 2024

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.

alanning avatar alanning commented on May 21, 2024

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.

manuel-schoebel avatar manuel-schoebel commented on May 21, 2024

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.

manuel-schoebel avatar manuel-schoebel commented on May 21, 2024

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.

alanning avatar alanning commented on May 21, 2024

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.

andreioprisan avatar andreioprisan commented on May 21, 2024

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.

alanning avatar alanning commented on May 21, 2024

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.

andreioprisan avatar andreioprisan commented on May 21, 2024

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.

datacarl avatar datacarl commented on May 21, 2024

@andreioprisan - What do you mean by linking in this case? How do you set it up?

from meteor-roles.

alanning avatar alanning commented on May 21, 2024

@datacarl Are you also seeing this problem if you use phantomjs 1.9.1?

from meteor-roles.

datacarl avatar datacarl commented on May 21, 2024

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.

datacarl avatar datacarl commented on May 21, 2024

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.

alanning avatar alanning commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.