Wrong file permissions for orca-build in Linux
Hi, We are several users using orca on the same system and we have to erase the orca-build folder in /tmp everytime a new user wants to run orca. This is because it is created with 755 as file permissions so other users can not write to it.
The line that creates the folder is located in /src/util/create-index.js:10 Documentation for mkdirsync says default permission should be 777 so it should work as it is now, but it doesn't for me. Can someone test if this is a local problem for me or everyone? I'm thinking it might be something with umask but my knowledge about that area is limited. I don't know anything about Node.js either but I would try to override the default 777 with 755 and see it that changes anything. Note that the mode option is not available on Windows. If the mode is set, would windows complain or just ignore it?
Docs on Node.js mkdirsync: https://nodejs.org/api/fs.html#fs_fs_mkdirsync_path_options
Thanks for the report and background research @Ejdamm! We'll try to take a look at some point, but can't promise how soon it will be.
Cross reference forum discussion https://community.plot.ly/t/plotly-orca-connectionrefusederror/19723
I can confirm that on my ubuntu system the permission of the /tmp/orca-build directory are set to drwxrwxr-x, which I expect would cause a problem if there were another user on the system.
Modification of src/util/create-index.js that worked for claudia
try {
fs.mkdirSync(PATH_TO_BUILD)
fs.chmodSync(PATH_TO_BUILD, 0777)
} catch (e) {}
try{
fs.readdir(PATH_TO_BUILD, (err, files) => {
if (err) throw err
for (const file of files) {
fs.unlink(path.join(PATH_TO_BUILD, file), err => {
if (err) throw err
})
}
})
} catch (e) {}
In addition to adjusting the permissions, they are explicitly deleting the temp files. If orca is not already cleaning up these files on exit, then we should take a look at that also.
I can also confirm that the solution by claudia also worked for me. I'm using this on a TLJH installation with multiple users successfully.
Hi guys, I still have problem on TLJH.
@kevmk04 I added lines from Caludia to the bottom of the file: /opt/tljh/user/pkgs/plotly-orca-1.2.1-1/lib/orca_app/resources/app/src/util/create-index.js but still no luck. Have you done anything else? @jonmmease I cannot understand exactly what you mean with adjusting the permissions. Which file? How to set the permissions?
Thank you in advance