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

Docker: Logfile permissions problems #426

Open
joschrew opened this issue Mar 21, 2024 · 3 comments · May be fixed by #429
Open

Docker: Logfile permissions problems #426

joschrew opened this issue Mar 21, 2024 · 3 comments · May be fixed by #429
Assignees

Comments

@joschrew
Copy link

When I run the ocrd_all docker-image as another user than root initLogging causes an error when trying to init the processing-server logfile. Because the logfile is already created during the docker image build process it is owned by root. When I start the ocrd_all container as another user, initLogging might be called and raises an error like this:

  File "/usr/local/bin/ocrd", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1685, in invoke
    super().invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ocrd/cli/network.py", line 25, in network_cli
    initLogging()
  File "/usr/local/lib/python3.8/site-packages/ocrd_utils/logging.py", line 181, in initLogging
    logging.config.fileConfig(config_file)
  File "/usr/lib/python3.8/logging/config.py", line 79, in fileConfig
    handlers = _install_handlers(cp, formatters)
  File "/usr/lib/python3.8/logging/config.py", line 145, in _install_handlers
    h = klass(*args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1147, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.8/logging/__init__.py", line 1176, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: '/tmp/ocrd_processing_server.log'
@decadance-dance
Copy link

The same issue here.

@mikegerber
Copy link
Contributor

Now using docker's --mount type=tmpfs,destination=/tmp. This may be a problem if any user switching is going on (not only here from root to some other user).

@mikegerber
Copy link
Contributor

Without knowing anything about processing server: Is a default global file-writable logfile a good idea? If this were optional, user could enable one of their choosing? How about workspace-local or syslog/journal?

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

Successfully merging a pull request may close this issue.

4 participants