Skip to main content

Announcement: Change of the CDN of climatejustice.social 2023-07-13

Summary

Type
Public service announcement
Summary
Change of the CDN of climatejustice.social
Impact
Media from climatejustice.global possibly not showing on remote instance(s)
Duration n/a
Status

Call for action

Reporter(s)
@paula@wien.rocks, @Anoxinon@social.anoxinon.de, @Elischa@social.anoxinon.de
Responder(s)
@b2c@wien.rocks
Internal reference

https://wien.rocks/@Anoxinon@social.anoxinon.de/110655397288909668 

https://climatejustice.global/@b2c/110706775952337723

Introduction

We have been made aware of an issue associated with the recent migration of the Mastodon instance climatejustice.global.

The Mastodon instance climatejustice.global has been migrated from the former hosting provider masto.host to the private infrastructure of the fediverse.foundation. All media files were formerly hosted by masto.host's CDN located at https://cdn.masto.host/ , and those URLs are now no longer valid.

This means that every Fediverse instance that has formerly federated with climatejustice.global now most likely has broken links for all remote media URLs related to posts and media from climatejustice.global in their databases. This results in previously cached media from climatejustice.global not loading or not showing correctly when accessed by local users.

Please excuse the inconvenience!

Identification

Since the Fediverse consists of a multitude of applications, we sadly can't provide an exact solution for each application. We currently have only received reports from Mastodon instances, so we have concentrated on providing a fix for Mastodon. If you happen to run a different service that is affected by this issue please get in contact with @b2c@wien.rocks and we'll try to work with you and help mitigate the issue.

To identify if your instance is affected by the issue, please log into the PostgreSQL database of your instance and run the following query:

-- first connect to your mastodon schema, e.g.:
-- \CONNECT mastodon_production;

SELECT id,
       remote_url
FROM   media_attachments
WHERE  remote_url LIKE '%cdn.masto.host/climatejusticeglobal%';
Result

Query yields 0 results - you're good, you have no broken links on your instance. Thanks for checking!

Query yields 1 or more results - your instance is affected, please proceed to "Resolution" to fix the issue.

Resolution

Resolving the issue is a two-step process: first the broken links need to be fixed in the database, and afterwards the media cache must be refreshed.

Updating outed URLs in the database schema

Please log into the PostgreSQL database of your instance and run the following query to update all outdated links:

-- first connect to your mastodon schema, e.g.:
-- \CONNECT mastodon_production;

UPDATE media_attachments
SET    remote_url = REGEXP_REPLACE(remote_url,
                                   'https://cdn.masto.host/climatejusticeglobal',
                                   'https://climatejustice.global/system')
WHERE  remote_url LIKE '%cdn.masto.host/climatejusticeglobal%';

Refreshing cached media

To refresh the cached media run the following tootctl command via the Mastodon admin CLI:

# change to the Mastodon installation directory first, e.g.:
# "/opt/mastodon" or "/home/mastodon/live"

RAILS_ENV=production ./bin/tootctl media refresh --domain=climatejustice.global

This should resolve the issue.

Thanks for your consideration and support!

Sincerely,
The Fediverse Foundation

Addendum