What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello everyone, a couple of developers are using Linux desktop systems with multiple user accounts.
Hello everyone,
a couple of developers are using Linux desktop systems with multiple user accounts. Their own is never UID 1000. It seems that docker/sdk makes a mistake here or has hardcoded values for UID 1000. If I start our project on such a system with a user who has UID 1001, directory permissions are incorrectly set to UID 1000, which makes loggers and caches unable to write their files,
docker/sdk Version 1.23
How can we get this resolved? Any ideas?
PS: This can easily be replicated by setting up a VM and giving your user a different UID than 1000.
Comments
-
It worked fine for me with any UID on my Linux. However docker can have some cross-platform problems. I am not aware of it.
docker/sdk currently bakes UID when building docker images, so spryker user becomes with the UID of your user on host.
0 -
Could you run this one (name of image can be different based on your deploy.y,l) ?
docker run -it spryker_cli:dev id
0 -
Ok, first thing's first:
problems@failwhale:~/shop$ id uid=1001(problems) gid=1001(problems) groups=1001(problems),997(docker) problems@failwhale:~/shop$ docker run -it anon_dev_cli:dev id uid=1001(spryker) gid=82(www-data) groups=82(www-data) problems@failwhale:~/shop$ docker/sdk cli id --> DEVELOPMENT MODE uid=1001(spryker) gid=82(www-data) groups=82(www-data)
Starting docker/sdk works just fine, BUT when I reach the point where the demo data gets initialized, a log is trying to get written and that fails:
Command propel-copy-schema [vendor/bin/console propel:schema:copy] (In progress...) Store: DE | Environment: docker Clean schema directory Copy and merge schema files UnexpectedValueException - Exception: There is no existing directory at "/var/log/spryker/DE/ZED" and it could not be created: Permission denied in /data/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php (172) Command: vendor/bin/console propel:schema:copy Trace: #0 /data/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(100): Monolog\Handler\StreamHandler->createDir() #1 /data/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(42): Monolog\Handler\StreamHandler->write(Array) ...
The interesting thing here is the "Permission denied". If I have a peak into the log directory, this is how it's looking like:
problems@failwhale:~/shop$ docker/sdk cli --> DEVELOPMENT MODE ββββββ βββ βββββ¬ββ βββββ β ββββΌββββ¬ββ¬ββ¬ββ¬ββ€ βββ¬ββββ¬ββ¬ββ β βββ€ β ββ ββ ββββ β βΌ β βββ€ β βββββ€ βΌββ€ βββ β βββ€ βββ¬β ββ ββββββ€ ββ΄ββ βββ βββ΄ββ΄ββββ΄ββ βββββ΄ββββ΄ββββ ββββ βββββ ββ/data | Store: DE | Env: docker | Debug: (.) | Testing: (.) β°β$ ls -la /var/log/spryker total 12 drwxr-xr-x 2 1000 spryker 4096 Nov 4 21:22 . drwxr-xr-x 1 root root 4096 Nov 4 21:19 .. -rw-r--r-- 1 root root 1521 Nov 4 21:22 supervisord.log
This line is the interesting one:
drwxr-xr-x 2 1000 spryker 4096 Nov 4 21:22 .
To me, it's looking like the image gets built properly but some process
chown
s that folder in a hardcoded process or something of that magnitude.Specs of what I'm testing with:
problems@failwhale:~/shop$ docker --version Docker version 19.03.13, build 4484c46d9d problems@failwhale:~/shop$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal
Any ideas?
0 -
0
-
- I would advise to use <php://stderr> for logs.
- /var/log/spryker is a volume in docker-compose. It seems it is inited with 1000 UID.
0 -
/var/log/spryker is a volume in docker-compose. It seems it is inited with 1000 UID.
How can I change this behaviour? Again, this means docker/sdk is broken for this use case where the user does not have UID 1000.
0 -
I agree it is a problem we need to solve. Probably it is outside of docker/sdk responsibility as it is docker-compose side effect.
However if you use <php://stderr> for logs docker/sdk works regardless UID. And that is the only proper way to do logging in containers. Files must not be used.
0 -
One more follow up question: How will I use docker/sdk logs then? What it normally does is to tail the logs.
0 -
There are 2 options:
docker logs spryker_yves_1 -f
Using docker logs.- You can use dashboard service:
dashboard: engine: dashboard endpoints: spryker.local:
There is a link to UI that shows logs from all containers.
0 -
We are thinking about extending docker/sdk logs to manage logs in more appropriate way
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 77 Spryker News
- 939 Developer Corner
- 795 Spryker Development
- 90 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 28 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 33 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random