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

Swarm mode and single container #43

Open
jwaes opened this issue Feb 15, 2024 · 2 comments
Open

Swarm mode and single container #43

jwaes opened this issue Feb 15, 2024 · 2 comments

Comments

@jwaes
Copy link

jwaes commented Feb 15, 2024

When i enable SWARM_MODE everything works fine with labels in other stacks. But when i add a label to a single container in the docker host i get this error:

2024-02-15 09:42:42,947 - INFO: ------------------------- Detected Config -------------------------
2024-02-15 09:42:42,949 - INFO: service: web
2024-02-15 09:42:42,950 - INFO:  - volume: /var/lib/docker/volumes/restic-backup_test/_data -> /volumes/restic-backup/web/srv/tests
2024-02-15 09:42:42,951 - INFO: service: None
Traceback (most recent call last):
  File "/usr/bin/rcb", line 33, in <module>
    sys.exit(load_entry_point('restic-compose-backup', 'console_scripts', 'rcb')())
  File "/restic-compose-backup/restic_compose_backup/cli.py", line 30, in main
    status(config, containers)
  File "/restic-compose-backup/restic_compose_backup/cli.py", line 102, in status
    container.get_volume_backup_destination(mount, '/volumes'),
  File "/restic-compose-backup/restic_compose_backup/containers.py", line 245, in get_volume_backup_destination
    destination /= project_name
  File "/usr/lib/python3.7/pathlib.py", line 925, in __truediv__
    return self._make_child((key,))
  File "/usr/lib/python3.7/pathlib.py", line 704, in _make_child
    drv, root, parts = self._parse_args(args)
  File "/usr/lib/python3.7/pathlib.py", line 658, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
ERROR: 1

Need some defaults for projectname and for service name for not docker-compose containers.

@einarf
Copy link
Member

einarf commented Feb 21, 2024

Can you elaborate?

@jwaes
Copy link
Author

jwaes commented Feb 21, 2024

@einarf

so when i have swarm mode enabled, and use the right labels in a docker-compose file all works fine.

But when i add a single container on that docker host, for example using portainer with the correct labels, as you can see above, while detecting the config, it finds this container, but gets 'None' for the service name. Because this 'single' container does not belong to a docker-compose stack.

Hope that is more clear.

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

No branches or pull requests

2 participants