Bad error reporting on config permissions error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
In Progress
|
Medium
|
Bing Hu |
Bug Description
I'm sure somewhere in the get_config code in utils we use ConfigParser's .read method to read a list of config files, and it is maybe silently passing over files that it doesn't have permission to read.
But the end result is very surprising:
vagrant@saio:~$ swift-init object start -c 1
WARNING: Unable to modify file descriptor limit. Running as non-root?
WARNING: Unable to modify max process limit. Running as non-root?
Starting object-
bind_port wasn't properly set in the config file. It must be explicitly set to a valid port number.
vagrant@saio:~$ ls -alhF /etc/swift/
-rw------- 1 root root 133 Jan 14 02:33 /etc/swift/
Changed in swift: | |
assignee: | nobody → Bing Hu (hubingsh) |
Changed in swift: | |
importance: | Low → Medium |
I checked the code, found that:
there are two kinds of configurations: single config file(xx.conf) and config files under config dir(xx.conf.d).
swift can report permission error when can't read single config file object- server/ 2.conf: [Errno 13] Permission denied: '/etc/swift/ object- server/ 2.conf'
Error trying to load config from /etc/swift/
but it will not report permission error when can't read files under config dir.
my ideal is to print warning log when can't read files under config dir, so that we can locate the error.
li@swift: /etc/swift/ object- server/ 1.conf. d$ swift-init object start -c 1 object- server/ 1.conf. d/bind. conf
WARNING: Unable to modify file descriptor limit. Running as non-root?
Warning: Read permission denied: /etc/swift/
Starting object- server. ..(/etc/ swift/object- server/ 1.conf. d)
bind_port wasn't properly set in the config file. It must be explicitly set to a valid port number.