Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Strange bash script behaviour on Heroku #712

Open
berkant opened this issue May 11, 2019 · 0 comments
Open

Strange bash script behaviour on Heroku #712

berkant opened this issue May 11, 2019 · 0 comments

Comments

@berkant
Copy link

berkant commented May 11, 2019

versions

  • SlimerJS: 1.0.0
  • Firefox: 59.x
  • Operating system: Ubuntu 18.04

Steps to reproduce the issue

Heroku CLI provides a method to run one-off containers in detached/non-interactive mode (heroku run:detached). I use this command to wget a remote bash script and execute it. In the script, I have these lines:

#!/usr/bin/env bash

set -x

echo "Starting..."
slimerjs --headless /tmp/script.js
echo "Finishing..."

# now calling webhook to notify other end
curl -v -d 'done=xyz' https://webhook.example.com 

However the process exits with 0 and the lines after slimerjs never work.
It's weird that when running in interactive mode (full TTY), the script works as expected.

Actual results:

2019-05-11T17:23:32.125165+00:00 app[run.7880]: + echo Starting...
2019-05-11T17:23:32.125212+00:00 app[run.7880]: Starting...
2019-05-11T17:23:32.125295+00:00 app[run.7880]: + slimerjs --headless /tmp/script.js
2019-05-11T17:23:34.472415+00:00 app[run.7880]: Waiting for the button to fully appear...
2019-05-11T17:23:35.472665+00:00 app[run.7880]: Starting to render the page...
2019-05-11T17:23:37.666730+00:00 app[run.7880]: Completed. Exiting now...
2019-05-11T17:24:00.678075+00:00 heroku[run.7880]: State changed from up to complete
2019-05-11T17:24:00.660840+00:00 heroku[run.7880]: Process exited with status 0

Expected results:

2019-05-11T17:23:32.125165+00:00 app[run.7880]: + echo Starting...
2019-05-11T17:23:32.125212+00:00 app[run.7880]: Starting...
2019-05-11T17:23:32.125295+00:00 app[run.7880]: + slimerjs --headless /tmp/script.js
2019-05-11T17:23:34.472415+00:00 app[run.7880]: Waiting for the button to fully appear...
2019-05-11T17:23:35.472665+00:00 app[run.7880]: Starting to render the page...
2019-05-11T17:23:37.666730+00:00 app[run.7880]: Completed. Exiting now...
2019-05-11T17:23:37.666730+00:00 app[run.7880]: + echo Finishing...
2019-05-11T17:23:37.666730+00:00 app[run.7880]: Finishing...
2019-05-11T17:23:37.666730+00:00 app[run.7880]: . . .
2019-05-11T17:23:37.666730+00:00 app[run.7880]: ( curl verbose... )
2019-05-11T17:23:37.666730+00:00 app[run.7880]: . . .
2019-05-11T17:24:00.678075+00:00 heroku[run.7880]: State changed from up to complete
2019-05-11T17:24:00.660840+00:00 heroku[run.7880]: Process exited with status 0
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant