Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Chrome browser does not start, in cron. (Ubuntu) #346

Closed
lunst97 opened this issue Mar 12, 2023 · 1 comment
Closed

Chrome browser does not start, in cron. (Ubuntu) #346

lunst97 opened this issue Mar 12, 2023 · 1 comment

Comments

@lunst97
Copy link

lunst97 commented Mar 12, 2023

I have a code that downloads a file from a website, it only works with the setting (headless: false) otherwise it just doesn't download anything.
I add the task of running the script to cron and I get this error (home/peeper/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/ferrum-0.13/lib/ferrum/browser/process.rb:157:in parse_ws_url: Browser did not produce websocket url within 10 seconds, try to increase :process_timeout. See https://github.com/rubycdp/ferrum#customization (Ferrum::Process Timeout Error)
)

And this error is present only if you run the code from under cron, everything works in a normal console.

Cron:
eval "$(~/.rbenv/bin/rbenv init - bash)"
DISPLAY=:0
cd /home/peeper/xxx && /home/peeper/.rbenv/versions/2.7.2/bin/ruby main.rb

@route
Copy link
Member

route commented Mar 16, 2023

Meaning that you are running non-interactive shell? https://askubuntu.com/questions/503028/how-to-launch-interactive-shell-script-in-bash-hourly-with-cron

@route route closed this as completed Mar 16, 2023
@rubycdp rubycdp locked and limited conversation to collaborators Mar 16, 2023
@route route converted this issue into discussion #349 Mar 16, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants