theunraveler / taskwarrior-web

A web interface for the Taskwarrior todo application. Because being a neckbeard is only fun sometimes.
http://theunraveler.github.com/taskwarrior-web
MIT License
526 stars 63 forks source link

error starting container wtih "make run" - cannot start service app - trying to mount directory onto a file or vice versa #120

Closed meonkeys closed 5 years ago

meonkeys commented 5 years ago

make run doesn't work for me. I'm on Ubuntu 18.04 LTS and I installed Docker via snap.

The first error I got was:

$ make run

... 8< 8< 8< 8< (snip) 8< 8< 8< 8< ...

Step 12/12 : CMD task-web -F -L
 ---> Using cache
 ---> a7f4286bedc3
Successfully built a7f4286bedc3
Successfully tagged taskwarrior-web_app:latest
Creating taskwarrior-web_app_1 ... error

ERROR: for taskwarrior-web_app_1  Cannot start service app: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/home/user/snap/docker/321/.taskrc\\\" to rootfs \\\"/var/snap/docker/common/var-lib-docker/aufs/mnt/9b14ab71e4aad43719bc91bb8d65e1b82c70814eccfedc57bdbb7a96c6ac703f\\\" at \\\"/var/snap/docker/common/var-lib-docker/aufs/mnt/9b14ab71e4aad43719bc91bb8d65e1b82c70814eccfedc57bdbb7a96c6ac703f/root/.taskrc\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for app  Cannot start service app: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/home/user/snap/docker/321/.taskrc\\\" to rootfs \\\"/var/snap/docker/common/var-lib-docker/aufs/mnt/9b14ab71e4aad43719bc91bb8d65e1b82c70814eccfedc57bdbb7a96c6ac703f\\\" at \\\"/var/snap/docker/common/var-lib-docker/aufs/mnt/9b14ab71e4aad43719bc91bb8d65e1b82c70814eccfedc57bdbb7a96c6ac703f/root/.taskrc\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.
Makefile:2: recipe for target 'run' failed
make: *** [run] Error 1

I noticed that ~/snap/docker/321/.taskrc was a directory, so I removed it, and ran touch ~/snap/docker/321/.taskrc.

Now make run exits successfully, but the container dies:

$ docker ps -a
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                      PORTS               NAMES
61e37afecbae        taskwarrior-web_app   "/bin/sh -c 'task-we…"   12 minutes ago      Exited (1) 12 minutes ago                       taskwarrior-web_app_1

Ruby then crashes trying to load a file:

$ docker logs taskwarrior-web_app_1
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bigdecimal (LoadError)
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/gems/2.5.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/big_decimal/conversions.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/gems/2.5.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/big_decimal.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/gems/2.5.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext.rb:2:in `block in <top (required)>'
    from /usr/lib/ruby/gems/2.5.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext.rb:1:in `each'
    from /usr/lib/ruby/gems/2.5.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/gems/2.5.0/gems/taskwarrior-web-1.1.12/lib/taskwarrior-web.rb:5:in `<top (required)>'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/lib/ruby/gems/2.5.0/gems/taskwarrior-web-1.1.12/bin/task-web:6:in `<top (required)>'
    from /usr/bin/task-web:23:in `load'
    from /usr/bin/task-web:23:in `<main>'
meonkeys commented 5 years ago

This may be specific to snap-installed Docker and docker-compose. I cannot repro on another Ubuntu 18.04 LTS computer where Docker was installed via apt.

Zebradil commented 5 years ago

Try to remove .taskrc and initialize it with task command first. Docker version of taskwarrior-web relies on existing configuration. I suppose that the empty .taskrc file doesn't work.

Zebradil commented 5 years ago

I reproduced the issue. Doesn't matter which .taskrc is used.

Zebradil commented 5 years ago

FROM alpine was used in the Dockerfile. Switching back to alpine:3.7 solves the issue.