GithubHelp home page GithubHelp logo

Comments (13)

LongLiveCHIEF avatar LongLiveCHIEF commented on May 28, 2024 1

This sounds like a host configuration issue. Let me explain.

docker containers don't have udev rules because containers don't do kernel things, and udevadm is most definitely a kernel process.

What you describe is typically caused when the host user that is running the docker/docker-compose commands not being part of the docker (or whatever group the docker-daemon uses), dialout and plugdev groups on the host machine.

When you run a container (such as the default octoprint image) as a non-root user, you either have to add privileges to your docker command, or use the --privileged flag and mount /dev:/dev.

Can you verify that your host user has the groups above, and if so, can you share your docker-compose file?

from octoprint-docker.

LongLiveCHIEF avatar LongLiveCHIEF commented on May 28, 2024 1

from octoprint-docker.

cab404 avatar cab404 commented on May 28, 2024 1
$ ls -l /dev | grep ttyUSB
crw-rw----  1 root dialout 188,   0 Aug 17 00:13 ttyUSB0

$ docker-compose exec octoprint bash -c 'ls -l /dev | grep ttyUSB'
crw-rw---- 1 root sudo 188, 0 Aug 16 23:57 ttyUSB0

I guess GID 27 just turned out to be sudo inside a container, that's why granting sudo is not a universal solution.
I won't be making a network accessible container with python2.7 inside privledged either)

My temporary solution was to grant sudo though.

from octoprint-docker.

LongLiveCHIEF avatar LongLiveCHIEF commented on May 28, 2024 1

You may want to also consider trying out the new octoprint/octoprint:1.4.2-camera image variant we just published yesterday. It uses a different permissions model that we'll be bringing to the main image variants over the next few days.

from octoprint-docker.

cab404 avatar cab404 commented on May 28, 2024

docker-compose.yml

version: '3.7'

services:
  octoprint:
    image: octoprint/octoprint
    ports:
      - 5000:5000
    devices:
     - /dev/ttyUSB0:/dev/ttyUSB0
    volumes:
     - octoprint:/home/octoprint

volumes:
  octoprint:

groups of a user running docker-compose

users wheel dialout tor networkmanager docker plugdev avahi

docker image info:

REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
octoprint/octoprint   latest              c7e8e6e2fcf8        2 days ago          701MB

from octoprint-docker.

cab404 avatar cab404 commented on May 28, 2024

docker containers don't have udev rules because containers don't do kernel things, and udevadm is most definitely a kernel process.

I thought that udev doesn't work with guest groups (guest groups lose names in the host system, and mappings are implemented by docker)

from octoprint-docker.

cab404 avatar cab404 commented on May 28, 2024

I am probably wrong about fixing it by granting sudo though. It might vary from system to system

from octoprint-docker.

cab404 avatar cab404 commented on May 28, 2024

What do you get when you run ls /dev | grep tty

On Sun, Aug 16, 2020, 7:46 PM Cabia Rangris @.***> wrote: I am probably incorrect about fixing it with granting sudo though. It might vary from system to system — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#64 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZBLAKMOZRDTVV63TMNLJ3SBB4U3ANCNFSM4QBCTNOA .

In container:

tty
ttyUSB0

On host

tty
tty0..63
ttyS0..3
ttyUSB0

from octoprint-docker.

cab404 avatar cab404 commented on May 28, 2024

GID for ttyUSB0 is 27 in both.

from octoprint-docker.

LongLiveCHIEF avatar LongLiveCHIEF commented on May 28, 2024

Yeah, each OS has slightly different udev rules for serial, character, and USB devices. Adding to the group inside the container does nothing really, it's all about the host.

from octoprint-docker.

LongLiveCHIEF avatar LongLiveCHIEF commented on May 28, 2024

I will be including a section on setting up your host in the new docs, and this is a good reminder to put in a section around groups and permissions of the user running octoprint and those of the device attached to the container.

from octoprint-docker.

LongLiveCHIEF avatar LongLiveCHIEF commented on May 28, 2024

Also, don't think that just because I closed this PR that your contributions aren't welcome. I just want to make sure we know what problems we're solving so we can consider what problems we might also be causing so that we can add those things to our testing (which is also coming soon). 😃

There is a dev-docker channel on the official OctoPrint Discord if you ever want to chat in real time, or consult on development.

from octoprint-docker.

cab404 avatar cab404 commented on May 28, 2024

from octoprint-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.