Troubleshooting Failed Token Refresh
The channel access tokens that Salt clients use to download packages from Uyuni expire and are replaced regularly.
A Taskomatic job named TokenCleanup refreshes the tokens in the server database.
By default, it then deploys the new credentials to the affected clients.
This is controlled by the server.susemanager.token_refresh_auto_deploy setting.
When the setting is disabled, the job only writes a warning to the log that lists the affected clients, and no client receives the new tokens.
If a client is offline or unreachable when the job runs, the server database holds the new token but the client does not. The job does not retry on later runs, because it finds the tokens in the database valid.
When this happens, the client keeps outdated tokens in /etc/zypp/repos.d/susemanager:channels.repo.
Running zypper ref or zypper up directly on the client, or using an external tool that does so, does not refresh the tokens and fails with an error like this:
Retrieving repository '<repository name>' metadata ....[error] Repository '<repository name>' is invalid. [susemanager:<channel label>|https://<server>:443/rhn/manager/download/<channel label>?<token>] Valid metadata not found at specified URL
On the server, /var/log/rhn/rhn_web_ui.log records the rejected requests as INFO messages like Forbidden: Token … is not valid to access repomd.xml.
These messages are only written while INFO logging is enabled for the com.suse.manager.webui.controllers.DownloadController logger, which is the default.
The same Valid metadata not found message can also be caused by incomplete repository metadata regeneration.
For more information, see Troubleshooting Taskomatic.
To fix an affected client immediately, apply the channels state or a highstate to it.
Any other channel-related action in Uyuni, such as changing the channel assignment or installing a package, also redeploys the current tokens.
To prevent the problem, schedule a recurring action for the organization that redeploys the certificates and channel configuration. Clients that were unavailable during a token refresh then receive the current tokens the next time the action runs.
In the Uyuni Web UI, navigate to .
Click the name of the organization to configure.
Navigate to the
Recurring Actionstab and click Create.Select an action type from the
Action Typedropdown:
Highstateapplies the complete configuration of each client.
Custom stateapplies only the states you select.Type a name for the schedule.
Choose a frequency, for example
WeeklyorDaily.For actions of type
Custom state, search for and selectSync All,Certificates, andChannels, which are theutil.syncall,certs, andchannelsstates, and click Save Changes.In the next pane, drag and drop the states into that order and click Confirm.
Click Create Schedule.
For more information about recurring actions, see Recurring Actions.
|
Repeat this procedure for every organization that contains clients that are not always online. |
|
Only the Uyuni Administrator can open the organization from . Organization Administrators can create the same recurring action in . |