Project

General

Profile

Actions

Bug #12325

closed

Avatars are broken after restoring Foreman DB on a new host

Added by Frank Hart over 8 years ago. Updated over 5 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 #1

Updated by Dominic Cleal over 8 years ago

  • Category set to Authentication
Actions #2

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Shlomi Zadok
  • Pull request https://github.com/theforeman/foreman/pull/2888 added
Actions #3

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 104
Actions #4

Updated by Shlomi Zadok over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #5

Updated by Dominic Cleal over 8 years ago

Actions

Also available in: Atom PDF