tensorboard: Permission denied issue when writing to `/tmp/.tensorboard-info`
- TensorBoard version (from pip package, also printed out when running
tensorboard) 1.13.1 - TensorFlow version if different from TensorBoard 1.13.1
- OS Platform and version (e.g., Linux Ubuntu 16.04) Ubuntu 16.04
- Python version (e.g. 2.7, 3.5) 2.7
Please describe the bug as clearly as possible, and if possible provide a minimal example (code, data, and/or command line) to reproduce the issue. Thanks!
The writing of tensorboard info files introduced in https://github.com/tensorflow/tensorboard/pull/1806 can cause permission problem under multi-user scenario. It directly create .tensorboard-info directory under /tmp as in https://github.com/tensorflow/tensorboard/blob/5fc3c8cea4b5f79c738345686a218f089b58ddba/tensorboard/manager.py#L237 . If the dir has already been created by an user, it will not be writable to other users.

About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 18
- Comments: 24 (9 by maintainers)
Commits related to this issue
- manager: ensure info directory world-accessible Summary: Fixes #2010. This patch is primarily directed at Unices. On Windows, the underlying problem should not be an issue, because the default tempo... — committed to tensorflow/tensorboard by wchargin 5 years ago
- manager: make TensorBoardInfo directory universally accessible and useful (#2131) Summary: Fixes #2010. This patch is primarily directed at Unices. On Windows, the underlying problem should not ... — committed to tensorflow/tensorboard by wchargin 5 years ago
- tools: create `diagnose_me` Summary: Users often report problems that depend on environment-specific configuration. Rather than asking them to find all this information and enter it into an issue tem... — committed to tensorflow/tensorboard by wchargin 5 years ago
- tools: create `diagnose_tensorboard` (#2237) Summary: Users often report problems that depend on environment-specific configuration. Rather than asking them to find all this information and enter ... — committed to tensorflow/tensorboard by wchargin 5 years ago
My workaround while this issue is resolved involves setting the TMPDIR environment variable. Since tensorboard uses tempfile which will respect user set environment variables (TMPDIR, TMP, etc.), this is possible. Make sure that the directory which TMPDIR points to exists!
You can change and test the new temp directory by running the following (which sets it to /tmp/$USER instead of /tmp).
A safe tensorboard invocation is:
@reactivetype: Thanks. It looks like your
.tensorboard-infodirectory was created with an older version of TensorBoard, before the fix went in. You’ll need to manually change its permissions just this once:Hi @tete1030! Thanks for the clear report. This is a good point—I’d considered the multi-user case and determined that it wouldn’t be a problem for reading files in this directory, but didn’t realize that it would not be possible to write new files in the directory.
I think that the following patch should suffice, at least on Unices:
I’ll have to test this on Windows. If you’re looking for a quick fix, you should be able to patch your TensorBoard install as above. (Or just
chmod a+w /tmp/.tensorboard-info, which will work until the next time that/tmp/is cleared.)Hey there, just stumbled upon this, I just thought I’d mention that this patch doesn’t fix the issue from the non-sudo user perspective. I added the patch first, but It did not fix the problem, as I do not have write access on that directory anyway. I’m gonna try and change the “.tensorboard-info” name to something unique, and hope this works. I’m thinking it might be nice to be able to customize this location, on a per-user basis ?
Yep, using
TMPDIRin this format is specifically encouraged by POSIX. That’s a good workaround; thanks for sharing!(You probably want to use either
/tmp/selgsor/tmp/.selgsin both lines, and you can also just useTMPDIR=/tmp/selgs tensorboardto set an environment variable for one command; no need to useenv, which spawns an extra process.)@tete1030 Any update on this ? @wchargin Please let me know if you want me to keep this issue open until Windows test ?
@alwynmathew: Who owns the
/tmp/.tensorboard-infodirectory? (Find out withstat --format=%U /tmp/.tensorboard-info.) That user—probably whoever created the directory—canchmodit or remove it.hey @wchargin I have installed tensorboard 1.14 but I face the same issues. Seems like I have a
.tensorboard-infodirectory created with an older version of TensorBoard. As I’m not a sudoer, I dont have permission to delete or change the permission of/tmp/.tensorboard-info/. Is there a way to fix it without going to our admin requesting to delete or change the permission of/tmp/.tensorboard-info/?@wchargin I am using ubuntu with tb-nightly 1.14.0a20190506 and I still have the issue.