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

Many colons in serial path worked before, but stopped working a week or so ago[BUG] <title> #12052

Closed
Mastiffen opened this issue Aug 9, 2024 · 1 comment · Fixed by compose-spec/compose-go#676

Comments

@Mastiffen
Copy link

Description

I have a Docker image of SignalK with two connected serial ports in my boat Pi, one ESP32 NMEA2000 Sailor Hat and another one for NMEA1883 from the Garmin plotter. Using USB0/USB1 meant that they can change places after a reboot, and then neither of them will work. That happened to me today, because a week or so ago my Docker Compose file with this entry stopped working, after having worked for a couple of years or so:

    devices:
      - /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0:/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0
      - /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0:/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0

After the update I had on the Pi 4 about a week ago it throws this error:

invalid spec: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0:/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0: too many colons

I tried with double and single quotes and the Unicode \u0003A, but that did not work.

I tried using a regular Docker command, from Decomposerize, but that thew an error as well (and that would have done it even before, as far as I could understand when posting this issue as an issue at the moby git:

docker: bad format for path: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0:/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0.

According to those at the Docker forum who knows what they are talking about (unlike me...) it really shouldn't have worked for the last couple of years, but it did. The final solution was to create symlinks. That works.

Steps To Reproduce

  1. Connect two serials.
  2. Put in serial by path.
  3. Try to start it up.

Compose Version

docker compose version
Docker Compose version v2.29.1

docker-compose version
bash: fant ikke kommando docker-compose
(Norwegian for could not find the command docker-compose)

Docker Environment

Client: Docker Engine - Community
 Version:    27.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.16.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 5
  Running: 4
  Paused: 0
  Stopped: 1
 Images: 5
 Server Version: 27.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.6.31+rpt-rpi-v8
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 3.702GiB
 Name: MadMax
 ID: ec620975-9ab2-4aa7-9e49-671d6c402fee
 Docker Root Dir: /media/pi/Docker/Docker-System
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support

Anything else?

No response

@ndeloof
Copy link
Contributor

ndeloof commented Aug 19, 2024

it really shouldn't have worked for the last couple of years, but it did

indeed, and while the code used to be flexible here and accept such a path with colons, such a confusing binding syntax should not be supported and would be subject to both confusion and potential bugs.
Using symlinks is indeed a good workaround
Actual fix imho is to add explicit support for "long syntax" to disambiguate such a path:

devices:
  - source: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0:
    target: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants