manyfold3d / manyfold

A self-hosted digital asset manager for 3d print files.
https://manyfold.app
MIT License
699 stars 45 forks source link

Problem running Docker image #2687

Closed Adam-Kay closed 15 hours ago

Adam-Kay commented 2 days ago

Describe the bug

Having a problem when creating the Docker instance provided here. I'm using the Solo image and when looking in the logs, I just get a looping error and can't access the Web interface. I'm a little new to Docker but as far as I can tell everything should be working - or I have misconfigured something.

To Reproduce

  1. Install Docker Image (with appropriate changes to volume etc.)
  2. Attempt to run
  3. Logs show looping error about "illegal option"

Log error

Tasks: TOP => db:prepare:with_data => environment
(See full trace by running task with --trace)
Preparing database...
/usr/local/lib/ruby/3.3.0/json/generic_object.rb:2: warning: /usr/local/lib/ruby/3.3.0/ostruct.rb was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
/usr/src/app/vendor/bundle/ruby/3.3.0/gems/opengl-bindings-1.6.14/lib/opengl.rb:1: warning: /usr/local/lib/ruby/3.3.0/fiddle.rb was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add fiddle to your Gemfile or gemspec to silence this warning.
Also please contact the author of opengl-bindings-1.6.14 to request adding fiddle into its gemspec.
Illegal option -p
sh: lspci: not found
Illegal option -p
sh: lspci: not found
bin/rails aborted!

Full log

_manyfold_logs.txt (latest 1000 lines)

Additional context

I'm using Portainer, but that's just a nice GUI on top of Docker so shouldn't be affecting anything.

SilverbackConnor commented 2 days ago

fwiw I can reproduce the same issue w/ the following docker-compose.yml: on a clean machine.


  app:
    image: ghcr.io/manyfold3d/manyfold-solo:latest
    ports:
      - 5055:3214
    volumes:
      - ./config:/config
      - ./archive:/libraries
    environment:
      SECRET_KEY_BASE: not-today-CIA
      PUID: 1000
      PGID: 1000
    restart: unless-stopped
    # Optional, but recommended for better security
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - DAC_OVERRIDE
      - SETUID
      - SETGID```
Floppy commented 2 days ago

Thanks, that's interesting, it's coming up with an SQLite database deadlock; I'll work out what's going on there.

Floppy commented 2 days ago

It would be interesting to know whether you get the same problem if you go back a version or two...

SilverbackConnor commented 2 days ago

Running the above docker-compose with the image set to image: ghcr.io/manyfold3d/manyfold-solo:0.78.0 has the same result. same with ....manyfold-solo:edge

Digging into it more, there was a file permissions issue regarding the database it made - only writable by root according to ls -l, which is what was making it hang.

Breaking both it and the archive directory (just in case) into submission via chmod seems to have done the trick to get it to boot, but it's still having a few issues, presumably file/dir perms related.

While it's not a loop anymore (and I can log in, use the UI), it fails to upload any files.

Relevant logs from the (fixed perms) run:

https://pastebin.com/JKTcjxfJ

There's no logs for the failed upload, from what I can tell. Here's the browser error, if that helps?

https://pastebin.com/FskPvC4Y

I'm not sure if this is the same issue as the OP now that I've gotten the perms issue out of the way, but it might be?

SilverbackConnor commented 2 days ago

Weirdly enough, making collections works without a hitch, it's just having issues uploading.

Floppy commented 1 day ago

If your upload problem is in edge, I know about that and am trying to work out what's up with it. I'd go back to the latest tag for now. Useful to know someone else has it though, thanks, I did wonder if it was a misconfiguration on my instance.

SilverbackConnor commented 1 day ago

Upload issue WAS in /edge, thanks for pointing that out. Seems to work! woohoo, Now I just gotta figure out how to properly use it I wish I could offer advice regarding the perms issue, but I barely know enough about docker to be dangerous, let alone helpful. Might be a container perms issue or something.

Good luck, and thanks for your work!

Floppy commented 1 day ago

@Adam-Kay does what @SilverbackConnor mentioned about permissions match your situation, by any chance?

Adam-Kay commented 1 day ago

@Adam-Kay does what @SilverbackConnor mentioned about permissions match your situation, by any chance?

My case is a little different, since my directory is a networked location added via fstab. Though the permissions for the location are marked as 0777 (rwx) for the user that is performing all of the actions, so I'm not sure if the problem is permissions-related

Floppy commented 1 day ago

OK, I'll leave this open and take a closer look. Did you try switching to an older version, perhaps v0.76.0? I think it might be a problem with doing an upgrade from older versions straight to v0.77.0, so it would be useful to know if that helps.

Adam-Kay commented 1 day ago

Just switched to ghcr.io/manyfold3d/manyfold-solo:0.76.0, still no luck. Receiving the same error:

`require'
Tasks: TOP => db:prepare:with_data => environment
(See full trace by running task with --trace)
Preparing database...
Illegal option -p
sh: lspci: not found
Illegal option -p
sh: lspci: not found
Floppy commented 1 day ago

OK, thanks for trying it. I'll dig in.

Floppy commented 15 hours ago

@Adam-Kay So, I've just run up a fresh instance of manyfold-solo here without problems. I wonder if perhaps something didn't shut down right before, and your sqlite database has somehow been left in a locked state - I've had that on occasion. Is there a manyfold.sqlite3 file (and perhaps also .shm and .wal) in your config mount, and if so, what happens if you move those aside and try again?