500 terugkerend bij het opvragen van aangepaste avatars van gebruikers

I tried to upload a custom avatar, it could be succesfully uploaded, but when requesting https://example.com/user_avatar/example.com/example_user/96/11_2.png, it just returned 500 error. The default anonymous avatar has no this error.

Latest master Discourse branch.
Cloudflare R2 is used as my S3 storage.

Are you on an unsupported-install?

In any case 500 alone isn’t sufficient information. Please share the related log info and someone might help you.

2 likes

Of course. By the way, I have used Cloudflare R2 (S3-compatible) to store upload content, when I checked out files in the bucket, the avatar file was actually there, but clients could not access it with https://example.com/user_avatar/example.com/example_user/96/11_2.png, it’s so weird.

In production.log vond ik deze regel:

Processing by UserAvatarsController#show as PNG
  Parameters: {"hostname" => "echonet.icu", "username" => "where", "size" => "288", "version" => "12_2"}
Completed 418 in 599ms (Views: 4.1ms | ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 0.4ms)

This may be related to:

Could be an S3 issue with the latest version :thinking:.

Oké, ik hoop dat het slechts een probleem is van de huidige nachtelijke versie. Het is opgelost door een proxy in te stellen.

Hey @MoRanYue, could you elaborate more on how you solved it?

I facing the same problem.

Thanks

@avidseeker
Wanneer u een OSS-service gebruikt en uw server er geen toegang toe heeft, bijvoorbeeld, u bent in China en de verbindingen van uw server met Cloudflare R2 worden geblokkeerd door de lokale ISP. Wanneer clients proberen aangepaste avatarbronnen te verkrijgen, moet uw server deze verkrijgen van de OSS, maar faalt, en retourneert vervolgens 500 aan de clients.

In mijn geval, het instellen van twee omgevingsvariabelen: HTTP_PROXY en HTTPS_PROXY naar een proxyserver die toegang heeft tot uw OSS-service. Als u Discourse met standaardinstallatie hebt geïnstalleerd, moet in uw app.xml een veld genaamd env staan, voeg die twee variabelen toe en dan kunt u uitvoeren. Ik heb een niet-ondersteunde installatie gebruikt en Systemd gebruikt om Discourse te beheren, dus ik heb twee Environment-parameters toegevoegd in het .service-bestand.

Ik weet niet of uw land een netwerk censuursysteem heeft. Zo ja, dan kan ik aannemen dat u al weet wat u moet doen; zo niet, controleer de online status van uw OSS-service en uw instellingen met betrekking tot S3.

1 like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.