scala/scala-lang

cannot run dev server on docker compose

scarf005 opened this issue · 8 comments

To reproduce

  1. clone repo
  2. run

scala-lang/README.md

Lines 30 to 32 in decdf22

```
env UID="$(id -u)" GID="$(id -g)" docker-compose up
```

Log

despite following the exact step from README, I got:

$ env UID="$(id -u)" GID="$(id -g)" docker compose up
WARN[0000] /home/scarf/repo/etc/one-time-contribution/scala-lang/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 1/0
 ✔ Container scala-lang-jekyll-1  Created                                                                   0.0s 
Attaching to jekyll-1
jekyll-1  | Configuration file: /srv/jekyll/_config.yml
jekyll-1  |             Source: /srv/jekyll
jekyll-1  |        Destination: /srv/jekyll/_site
jekyll-1  |  Incremental build: enabled
jekyll-1  |       Generating... 
jekyll-1  | /usr/local/lib/ruby/3.0.0/fileutils.rb:253:in `mkdir': Permission denied @ dir_s_mkdir - /srv/jekyll/_site (Errno::EACCES)
jekyll-1  |     from /usr/local/lib/ruby/3.0.0/fileutils.rb:253:in `fu_mkdir'
jekyll-1  |     from /usr/local/lib/ruby/3.0.0/fileutils.rb:231:in `block (2 levels) in mkdir_p'
jekyll-1  |     from /usr/local/lib/ruby/3.0.0/fileutils.rb:229:in `reverse_each'
jekyll-1  |     from /usr/local/lib/ruby/3.0.0/fileutils.rb:229:in `block in mkdir_p'
jekyll-1  |     from /usr/local/lib/ruby/3.0.0/fileutils.rb:211:in `each'
jekyll-1  |     from /usr/local/lib/ruby/3.0.0/fileutils.rb:211:in `mkdir_p'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/convertible.rb:226:in `write'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:209:in `block in write'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:332:in `block (2 levels) in each_site_file'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:331:in `each'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:331:in `block in each_site_file'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:330:in `each'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:330:in `each_site_file'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:208:in `write'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:73:in `process'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/command.rb:28:in `process_site'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:65:in `build'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:36:in `process'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:93:in `block in start'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:93:in `each'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:93:in `start'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
jekyll-1  |     from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
jekyll-1  |     from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
jekyll-1  |     from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
jekyll-1  |     from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
jekyll-1  |     from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
jekyll-1  |     from /usr/local/bundle/gems/jekyll-3.9.3/exe/jekyll:15:in `<top (required)>'
jekyll-1  |     from /usr/local/bundle/bin/jekyll:25:in `load'
jekyll-1  |     from /usr/local/bundle/bin/jekyll:25:in `<top (required)>'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:58:in `load'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:58:in `kernel_load'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:23:in `run'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/cli.rb:492:in `exec'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/cli.rb:34:in `dispatch'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/cli.rb:28:in `start'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/exe/bundle:45:in `block in <top (required)>'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
jekyll-1  |     from /usr/local/bundle/gems/bundler-2.4.7/exe/bundle:33:in `<top (required)>'
jekyll-1  |     from /usr/local/bundle/bin/bundle:23:in `load'
jekyll-1  |     from /usr/local/bundle/bin/bundle:23:in `<main>'
jekyll-1  | jekyll 3.9.3 | Error:  Permission denied @ dir_s_mkdir - /srv/jekyll/_site
jekyll-1 exited with code 1

System info

OS: KDE neon jammy 22.04 x86_64
Kernel: Linux 6.8.0-40-generic
Shell: bash 5.1.16
Docker: version 27.1.2, build d01f264

the Docker stuff came in some years ago as an external contribution. not sure who we have internally who is able to troubleshoot, possibly @hamzaremmal could help or has an idea of who else we could ask?

Mmh, I remember using docker-compose a few weeks ago (or maybe it was for docs.scala-lang 😅) but I remember it working fine. I will take a look at this on my flight back tomorrow.

While not related to the failure, it seems removing the version statement at the beginning of the compose file would remove one of the warnings and probably avoid a future failure.

Whole not related to the failure, it seems removing the version statement at the beginning of the compose file would remove one of the warnings and probably avoid a future failure.

created #1679 for this

Whole not related to the failure, it seems removing the version statement at the beginning of the compose file would remove one of the warnings and probably avoid a future failure.

The version field is obsolete for quite some time now, @Philippus thanks for the PR.

I've tried to run the docker-compose command locally after rebuilding the image and removing all the previous containers and images and everything works fine. I will play around a little bit with it to attempt to reproduce the observed behaviour. Since it's a permission issue, @scarf005 does you user have anything special configured ?

not sure but maybe the docker compose command i ran and docker-compose from README might behave differently (i think docker-compose is outdated)

image

interesting, completely removing all references to UID and GID fixed it. it works in both rootless mode and regular docker. both generated output aren't created as root but as host user.

rootless root
image image

will open a PR.