Skip to content
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

SSSD Log: no_such_file_or_directory_modification #5622

Closed

Conversation

DDDas7
Copy link
Contributor

@DDDas7 DDDas7 commented May 5, 2021

Replacing no such file or directory error code with alternate message

Resolves: #5614

@ikerexxe
Copy link
Contributor

ikerexxe commented May 6, 2021

@elkoniu can you review it?

@elkoniu
Copy link
Contributor

elkoniu commented May 6, 2021

Sure, will be done today.

@DDDas7
Copy link
Contributor Author

DDDas7 commented May 6, 2021

Hi Iker, Pawel,

The error "No such file or directory" has been replaced with more relevant message "Machine is not on the network" since the earlier message was logged once fail over cycled through all available servers hence did not make sense.

Regards,
Deepak Das

Copy link
Contributor

@elkoniu elkoniu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting /usr/include/asm/errno.h:

#define ENOENT           2      /* No such file or directory */
#define ENONET          64      /* Machine is not on the network */

In the be_resolve_server_process() we are jumping on top of server list.
After entry is validated error code is returned. I am wondering if the better replacement would not be:

#define EHOSTDOWN       112     /* Host is down */

@sumit-bose can you advice here? I saw that EHOSTDOWN is rarely used in SSSD.

Copy link
Contributor

@elkoniu elkoniu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After giving it a second look I think it should be solved different.
ENOENT is used to tell that we tried all servers from the list and there is nothing more to check.
This is correct. The problem is that due to historical reasons it is printed as No such file or directory.
I thing that change should be done in function consuming this return - be_resolve_server_done (src/providers/data_provider_fo.c:578). This upper level function should check for ENOENT and align error message.

This is similar case to #5625

@DDDas7 DDDas7 force-pushed the log_no_such_file_or_directory_modification branch from 265dc74 to 8c332cf Compare May 26, 2021 11:36
Copy link
Contributor

@elkoniu elkoniu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small style related comment but generally it looks good :)

"Server resolution failed: [%d]: %s\n", ret, sss_strerror(ret));
if (ret == ENOENT) {
DEBUG(SSSDBG_TRACE_LIBS,
"Server resolution failed[%d]: All servers down\n", ret);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style error - white space missing in between failed and opening [ bracket.

"Server resolution failed[%d]: All servers down\n", ret);
} else {
DEBUG(SSSDBG_TRACE_LIBS,
"Server resolution failed: [%d]: %s\n", ret, sss_strerror(ret));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this line we have colon : after failed and brackets, where in upper line there is one after brackets. You may want to unify this to both have two or single colon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Pawel,

I have made the necessary changes. Can you please review.

Thank you!

Replacing no such file or directory error code with alternate message

Resolves: SSSD#5614
@DDDas7 DDDas7 force-pushed the log_no_such_file_or_directory_modification branch from 8c332cf to 4a5912f Compare May 27, 2021 07:48
Copy link
Contributor

@elkoniu elkoniu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pbrezina pbrezina added the Ready to push Ready to push label May 31, 2021
@pbrezina
Copy link
Member

Pushed PR: #5622

  • master
    • 9c06088 - SSSD Log: no_such_file_or_directory_modification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSSD Error Msg Improvement: Server resolution failed: [2]: No such file or directory
4 participants