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

crontab-ui in Docker Fails to Start #155

Closed
rousslabs opened this issue May 22, 2021 · 2 comments
Closed

crontab-ui in Docker Fails to Start #155

rousslabs opened this issue May 22, 2021 · 2 comments

Comments

@rousslabs
Copy link

Pull #139 seems to have broken crontab-ui when running in Docker.

Output when running the Container:

$ docker-compose up crontab-ui
Creating crontab-ui ... done
Attaching to crontab-ui
crontab-ui | 2021-05-21 23:19:53,582 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
crontab-ui | 2021-05-21 23:19:53,584 INFO supervisord started with pid 1
crontab-ui | 2021-05-21 23:19:54,588 INFO spawned: 'crontabui' with pid 8
crontab-ui | 2021-05-21 23:19:54,592 INFO spawned: 'crontab' with pid 9
crontab-ui | 2021-05-21 23:19:55,006 INFO exited: crontabui (exit status 1; not expected)
crontab-ui | 2021-05-21 23:19:56,010 INFO spawned: 'crontabui' with pid 16
crontab-ui | 2021-05-21 23:19:56,011 INFO success: crontab entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
crontab-ui | 2021-05-21 23:19:56,428 INFO exited: crontabui (exit status 1; not expected)
crontab-ui | 2021-05-21 23:19:58,432 INFO spawned: 'crontabui' with pid 23
crontab-ui | 2021-05-21 23:19:58,853 INFO exited: crontabui (exit status 1; not expected)
crontab-ui | 2021-05-21 23:20:01,859 INFO spawned: 'crontabui' with pid 30
crontab-ui | 2021-05-21 23:20:02,272 INFO exited: crontabui (exit status 1; not expected)
crontab-ui | 2021-05-21 23:20:03,273 INFO gave up: crontabui entered FATAL state, too many start retries too quickly

After a little digging, the issue is with the nullish coalescing operator used in routes.js.

Output when manually running crontab-ui inside the container:

/crontab-ui # node /crontab-ui/app.js
Cron db path: /crontab-ui/crontabs
Path to crond files set using env variables /etc/crontabs
/crontab-ui/routes.js:2
var base_url = process.env.BASE_URL ?? '';
__________________________________^
SyntaxError: Unexpected token ?
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/crontab-ui/app.js:15:16)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Nodejs needs to be at least v14.0.0 to support that operator. Version 10.24.1 is installed with Alpine 3.10.

Either removing the coalescing operator or bumping Alpine to v3.13 (and therefore nodejs-14.16.1-r1) allows the container to run again.

@ffrederiksen
Copy link

Have the same output in logs and have built the image with nodejs (14.16.1-r1) but still have the same problem when starting in Docker

alseambusher added a commit that referenced this issue May 22, 2021
@alseambusher
Copy link
Owner

Thanks for reporting the issue. I have fixed this in #156 and should be available in the latest docker image. If you still face issues with it, please feel free to re-open the issue.

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

3 participants