8000 Error: file exists @ dir_s_mkdir - ~/.config in dashboard initializer · Issue #4358 · OSC/ondemand · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Error: file exists @ dir_s_mkdir - ~/.config in dashboard initializer #4358

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

Open
hsmallbone opened this issue May 14, 2025 · 4 comments
Open
Labels
4.1 release Planned for 4.1 release community request
Milestone

Comments

@hsmallbone
Copy link
Contributor

Every time I onboard a new user to ondemand I get an error in the following line.
From tracing back, it looks like ondemand is trying to create ~/.config as a parent file for ~/.config/ondemand when ~/.config already exists. Net result is that new user cannot log in.

FileUtils.mkdir_p(new_file_dir) unless File.exist?(new_file_dir.to_s)

We are using RHEL9.5 with latest ondemand release.

@osc-bot osc-bot added this to the Backlog milestone May 14, 2025
@johrstrom johrstrom modified the milestones: Backlog, 4.1 May 14, 2025
@johrstrom
Copy link
Contributor

That is not very good news. Clearly there's something wrong here. We run EL9 too but don't encounter that. It should be working like mkdir -p which doesn't error when the directory already exists.

@hsmallbone
Copy link
Contributor Author

I suspect it is due to SELinux but haven't been able to track down any relevant denials in the audit logs as yet.

@johrstrom
Copy link
Contributor

Can you try to strace this command and post the output here? Here I'm using my abosolute HOME directory path, you'll need to replace it with your own.

 ruby -e 'require "fileutils"; FileUtils.mkdir_p("#{Dir.home}/.config/ondemand")'

I guess the actual replication is when the parent directory exists (~/.config in this example) but the child doesn't. You may have to tweak the path to accurately replicate the issue.

@hsmallbone
Copy link
Contributor Author
hsmallbone commented May 16, 2025

That works without an issue, but I'm not running it from ondemand process in that case.
It seems to definitely be SELinux related, as if I change the .config context to config_home_t (which restorecon will do) it will throw the error, but setting it back to user_home_t works.
https://apidock.com/ruby/FileUtils/mkdir_p seems to suggest that EEXIST may be called for permission issues.

Looking at the SELinux file https://github.com/OSC/ondemand/blob/master/packaging/rpm/ondemand-selinux.te I can't see config_home_t mentioned which seems to be the culprit.
I think that this would be required in all cases since OOD expects to be able to make the .config file and subdirectory.

@moffatsadeghi moffatsadeghi added community request 4.1 release Planned for 4.1 release labels May 16, 2025
@github-project-automation github-project-automation bot moved this to Milestone Bucket in 4.1 Categorization May 20, 2025
@moffatsadeghi moffatsadeghi moved this from Milestone Bucket to Medium Priority / Importance in 4.1 Categorization May 20, 2025
@moffatsadeghi moffatsadeghi moved this from Medium Priority / Importance to High Priority / Importance in 4.1 Categorization May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.1 release Planned for 4.1 release community request
Projects
Status: High Priority / Importance
Development

No branches or pull requests

4 participants
0