Skip to content

changing client backup restore order#184

Closed
danlavu wants to merge 1 commit intoSSSD:masterfrom
danlavu:roles-client-restore
Closed

changing client backup restore order#184
danlavu wants to merge 1 commit intoSSSD:masterfrom
danlavu:roles-client-restore

Conversation

@danlavu
Copy link
Contributor

@danlavu danlavu commented Apr 30, 2025

hitting a race condition causing authselect restore to fail because the home directory, containing the backup does not exist.

hitting a race condition causing authselect fails to restore because the home directory
does not exist.
@danlavu danlavu force-pushed the roles-client-restore branch from b63ac14 to 4d35c52 Compare May 1, 2025 00:01
@danlavu
Copy link
Contributor Author

danlavu commented May 1, 2025

SKIPPED ../sssd/src/tests/system/tests/test_local.py::test_local__user_authentication (client) - Skipped: unconditional skip
ERROR ../sssd/src/tests/system/tests/test_cli.py::test_cli__is_feature_enabled (client) - pytest_mh._private.errors.TeardownExceptionGroup: One or more error occurred during test teardown (1 sub-exception)
FAILED ../sssd/src/tests/system/tests/test_cli.py::test_cli__is_feature_enabled (client) - pytest_mh.conn.ssh.SSHProcessError: 
Command #376 exited with return code 1:
  Command:
    authselect select local with-mkhomedir --force --backup=multihost.backup
  CWD:
  Env:
  Output:
  Error output:
    [error] Unable to get profile information [2]: No such file or directory

@pbrezina
Copy link
Member

pbrezina commented May 5, 2025

Why do you think it is about home directory? Profile information is read from /usr and backup is stored in /var/lib. There is no home directory involved.

@danlavu
Copy link
Contributor Author

danlavu commented May 5, 2025

The home directory state I know is different. I haven't tested this, but regardless, I do think undoing changes in the opposite order is better.

hrmm.. I was rushing, and I know what you have told me before, every change should be tested. I'll do that first.

@pbrezina
Copy link
Member

pbrezina commented May 6, 2025

I'm puzzled. The error [error] Unable to get profile information [2]: No such file or director means that profile "local" is not available which may very well be true on fefora41 and lower and rhel9/c9s. The profile is read from /usr/share/authselect/default.

authselect select local with-mkhomedir --force --backup=multihost.backup does not read or write to /home at all.

}}

cp --force --archive "{backup_path}/home/*" /home/ || :
rm --force --recursive /etc/sssd /var/lib/sss /var/log/sssd /home/*
Copy link
Member

Choose a reason for hiding this comment

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

you are removing /home/* here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, it needs to be moved after that line.

@pbrezina
Copy link
Member

pbrezina commented May 6, 2025

I would like to see some reasoning, why do you think that order here matters? I don't see any reason, why it should matter, the result will still be the same as we only write to /home in this code only at one line. Other restore calls do not touch /home.

@danlavu
Copy link
Contributor Author

danlavu commented May 6, 2025

I saw the backup happening last, and that it was being restored last as well. Looking at the error message, while I know it's most likely referring to the backup data in /var [error] Unable to get profile information [2]: No such file or directory.

I can't see why that would be missing, but certainly, home didn't have the same contents or subfolders when it was backed up. It's not a good reason, but I wanted it to contain the same content when it restores.

@danlavu
Copy link
Contributor Author

danlavu commented May 6, 2025

Looking at it again, I misread the code. What I thought it was doing was not correct. This has no impact.

@danlavu danlavu closed this May 6, 2025
@danlavu danlavu deleted the roles-client-restore branch December 1, 2025 17:34
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.

3 participants