Actions
Bug #12325
closedAvatars are broken after restoring Foreman DB on a new host
Description
After restoring the Foreman DB on a new host, the avatars are broken. The file with the hash is created on disk in /usr/share/foreman/public/assets/avatars, but it is empty.
stbenjam on IRC recommended to run this on the Foreman host:
echo "User.all.each { |user| user.update_attributes(:avatar_hash => nil) }" | foreman-rake console
After logging in again, I get this in the logfile:
2015-10-27 14:23:44 [sql] [I] Successfully decrypted field for AuthSourceLdap Active Directory 2015-10-27 14:23:45 [app] [W] Action failed | Encoding::UndefinedConversionError: "\xFF" from ASCII-8BIT to UTF-8 | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:176:in `write' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:176:in `block in store_avatar' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:176:in `open' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:176:in `store_avatar' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:162:in `block in attributes_values' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:159:in `each' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:159:in `map' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:159:in `attributes_values' | /usr/share/foreman/app/models/auth_sources/auth_source_ldap.rb:53:in `authenticate' | /usr/share/foreman/app/models/user.rb:187:in `try_to_login' | /usr/share/foreman/app/controllers/users_controller.rb:71:in `login'
Actions