Project

General

Profile

Actions

Bug #12325

closed

Avatars are broken after restoring Foreman DB on a new host

Added by Frank Hart about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Authentication
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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'

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #12730: remove fakefs gemClosedTom Caspy12/07/2015Actions
Actions

Also available in: Atom PDF