"UnableToAcquireCurrentUserDetails" error during config lookup #675
-
Hi folks- I am running into a wierd config lookup error and may need your help to understand more about it. Context: I am running the native c pub-sub example in x86 Ubuntu 20.04. I did not manually create or configure iceoryx2.toml so I let the example create one for me. However when I ran the example, I ran into runtime error: 0 [F] "Config::global_config()"
| A failure occurred (UnableToAcquireCurrentUserDetails) while looking up the available config files.
thread '<unnamed>' panicked at iceoryx2/src/config.rs:589:17; I looked into the rust source code and it failed at iceoryx2_bb_posix::user::User::from_self() where it would pull uid and create user object. It didn't make sense to me it would fail. pub fn from_self() -> Result<User, UserError> {
Self::from_uid(unsafe { posix::getuid() })
} Then I did some experiments: I created my own config file and added following code to read from local instead of looking up and it compiled and ran fine. iox2_config_t config_ptr;
iox2_config_h handle_ptr = NULL;
int ret = iox2_config_from_file(NULL,&handle_ptr,"config/iceoryx2.toml") This trick gets me unblocked for now, but I’m curious if anyone knows what’s actually causing the issue and how to fix it the right way. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
@strawberry-peanut-butter Can you please tell us the iceoryx2 version you are using, and the rust version? And could you please set the log level to debug in the example where this occurs to provide us with more context information (Just copy and paste this in here). This can be done with: iox2_set_log_level(iox2_log_level_e_DEBUG); |
Beta Was this translation helpful? Give feedback.
-
Thank you Christian - good to see you here :) @elfenpiff 0 [D] FileBuilder { file_path: FilePath { value: FixedSizeByteString<255> { len: 20, data: "config/iceoryx2.toml" } }, ac
cess_mode: Read, permission: Permission(448), has_ownership: false, owner: None, group: None, truncate_size: None,
creation_mode: None }
| Unable to open file since it does not exist.
1 [D] Config { global: Global { root_path_unix: Path { value: FixedSizeByteString<255> { len: 14, data: "/tmp/iceoryx2/"
} }, root_path_windows: Path { value: FixedSizeByteString<255> { len: 17, data: "c:\Temp\iceoryx2\" } }, prefix: Fi
leName { value: FixedSizeByteString<255> { len: 5, data: "iox2_" } }, service: Service { directory: Path { value: F
ixedSizeByteString<255> { len: 8, data: "services" } }, publisher_data_segment_suffix: FileName { value: FixedSizeB
yteString<255> { len: 15, data: ".publisher_data" } }, static_config_storage_suffix: FileName { value: FixedSizeByt
eString<255> { len: 8, data: ".service" } }, dynamic_config_storage_suffix: FileName { value: FixedSizeByteString<2
55> { len: 8, data: ".dynamic" } }, creation_timeout: 500ms, connection_suffix: FileName { value: FixedSizeByteStri
ng<255> { len: 11, data: ".connection" } }, event_connection_suffix: FileName { value: FixedSizeByteString<255> { l
en: 6, data: ".event" } } }, node: Node { directory: Path { value: FixedSizeByteString<255> { len: 5, data: "nodes"
} }, monitor_suffix: FileName { value: FixedSizeByteString<255> { len: 13, data: ".node_monitor" } }, static_confi
g_suffix: FileName { value: FixedSizeByteString<255> { len: 8, data: ".details" } }, service_tag_suffix: FileName {
value: FixedSizeByteString<255> { len: 12, data: ".service_tag" } }, cleanup_dead_nodes_on_creation: true, cleanup
_dead_nodes_on_destruction: true } }, defaults: Defaults { publish_subscribe: PublishSubscribe { max_subscribers: 8
, max_publishers: 2, max_nodes: 20, subscriber_max_buffer_size: 2, subscriber_max_borrowed_samples: 2, publisher_ma
x_loaned_samples: 2, publisher_history_size: 0, enable_safe_overflow: true, unable_to_deliver_strategy: Block, subs
criber_expired_connection_buffer: 128 }, event: Event { max_listeners: 16, max_notifiers: 16, max_nodes: 36, event_
id_max_value: 4294967295, deadline: None, notifier_created_event: None, notifier_dropped_event: None, notifier_dead
_event: None }, request_response: RequestResonse { enable_safe_overflow_for_requests: true, enable_safe_overflow_fo
r_responses: true, max_active_responses: 4, max_active_requests: 2, max_borrowed_responses: 4, max_borrowed_request
s: 2, max_response_buffer_size: 2, max_request_buffer_size: 4, max_servers: 2, max_clients: 8, max_nodes: 20 } } }
| Failed to create config since the config file "config/iceoryx2.toml" does not exist.
2 [D] UserName { value: FixedSizeByteString<31> { len: 0, data: "" } }
| Unable to insert byte string "Peter-Ling" since it would result in an illegal content.
3 [D] "SemanticString::new()"
| Unable to create SemanticString due to an invalid value "Peter-Ling".
4 [D] "User::from(Uid(1002))"
| Unable to acquire user entry since the user name on the system is longer than the supported length of 31.
5 [D] "Config::iterate_over_config_files"
| Unable to consider all possible config file paths since the current user details could not be acquired.
6 [F] "Config::global_config()"
| A failure occurred (UnableToAcquireCurrentUserDetails) while looking up the available config files. |
Beta Was this translation helpful? Give feedback.
-
Bug was fixed #677 |
Beta Was this translation helpful? Give feedback.
Hey hey Peter, awesome to see you here!
It is a bug on our side. The structs
UserName
andGroupName
currently do not allow capital letters but they are officially supported by POSIX but not recommended for usage since a lot of internal linux/unix services do not distinguish between a letter and its capital counterpart.I allowed capital letters in those classes and created a PR #678. When this is merged it should work on your side.