# Миграция на S3: кастомные аватары пользователей отображаются как аватар по умолчанию

**URL:** https://meta.discourse.org/t/migrate-to-s3-custom-user-avatars-displaying-default-avatar/177706
**Category:** Support
**Created:** [29.Январь.2021 18:21:22 UTC](https://meta.discourse.org/t/migrate-to-s3-custom-user-avatars-displaying-default-avatar/177706 "2021-01-29T18:21:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [29.Январь.2021 18:21:22 UTC](https://meta.discourse.org/t/migrate-to-s3-custom-user-avatars-displaying-default-avatar/177706/1 "2021-01-29T18:21:22Z")

</div>

После миграции на S3 и пересоздания неоптимизированных постов кажется, что всё прошло успешно.

Однако все загруженные аватары пользователей, которые я видел, отображаются как аватар по умолчанию (серая иконка).

Теперь я не уверен, была ли миграция успешной. Не хочется выводить это в продакшн, пока не буду уверен.

Знает ли кто-нибудь, решится ли эта проблема сама собой?

Или кто-нибудь уже пробовал это?

> [@Generating missing optimized images with S3](https://meta.discourse.org/t/generating-missing-optimized-images-with-s3/35847/6?u=markersocial):
>
> I’m not sure if the following is complete, but this rails console command removes all optimized images then regenerates the ones used for avatars: OptimizedImage.destroy\_all UserAvatar.all.each {|ua| uaid = ua.gravatar\_upload\_id || ua.custom\_upload\_id; Jobs::CreateAvatarThumbnails.perform\_async(upload\_id: uaid) if uaid }

---

<div class="post-metadata">

### Author: ![topological](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@topological](https://meta.discourse.org/u/topological)
#### Post date: [19.Сентябрь.2022 13:57:20 UTC](https://meta.discourse.org/t/migrate-to-s3-custom-user-avatars-displaying-default-avatar/177706/2 "2022-09-19T13:57:20Z")

</div>

Я столкнулся с той же проблемой.

---

<div class="post-metadata">

### Author: ![markersocial](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markersocial/32/170136_2.png) [@markersocial](https://meta.discourse.org/u/markersocial)
#### Post date: [21.Сентябрь.2022 06:44:17 UTC](https://meta.discourse.org/t/migrate-to-s3-custom-user-avatars-displaying-default-avatar/177706/3 "2022-09-21T06:44:17Z")

</div>

Случайно не используете Cloudflare, @topological? Если я правильно помню, я решил эту проблему, добавив IP-адрес сервера в белый список в Cloudflare.
