Hi there, i have already tried to ask on Matrix, but maybe this would be a better place:
I have initiated a migration from local (network storage) to S3 (Backblaze). Uploads work, playback without proxy works now too (i had to learn how important the custom bucket rules are, oops, some failed jobs there), but with the proxy, i am getting a segment error similar to this already closed issue.
The nginx proxy is adopted from the Mastodon docs with minor adjustments:
location @s3 {
limit_except GET OPTIONS HEAD { # GET didnt seem enough
deny all;
}
resolver 8.8.8.8;
# proxy_set_header Host YOUR_S3_HOSTNAME; # backblaze generally doesnt seem to like this one
proxy_set_header Connection '';
proxy_set_header Authorization '';
proxy_hide_header Set-Cookie;
proxy_hide_header 'Access-Control-Allow-Origin';
proxy_hide_header 'Access-Control-Allow-Methods';
# proxy_hide_header 'Access-Control-Allow-Headers'; # this seemed to get rid of errors like "range"
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
proxy_hide_header x-amz-server-side-encryption;
proxy_hide_header x-amz-bucket-region;
proxy_hide_header x-amzn-requestid;
proxy_ignore_headers Set-Cookie;
proxy_pass $s3_backend$uri;
proxy_intercept_errors off;
proxy_cache tubecache;
proxy_cache_valid 48h;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
expires 1y;
add_header Cache-Control public;
add_header 'Access-Control-Allow-Origin' '*';
add_header X-Cache-Status $upstream_cache_status;
Now i wonder if the resulting commit of that bugreport would fix my issue as well, even tho i indeed see 206 statuscodes. And how i could cherry-pick that commit without bigger setup changes (i suppose i can replace that symlink with a git version though, now that i write about it).
Edit: just removing that proxy from the peertube config makes it two errors:
XHROPTIONShttps://media.tube.tchncs.de/videos/...
CORS Missing Allow Origin
XHROPTIONShttps://tube-tchncs-de.s3.eu-central-003.backblazeb2.com/videos/...
CORS Missing Allow Origin
Second issue
A user just reported that almost all of their videos are not visible anymore. If i click to see all videos as moderator, their videos are still there and neither private nor unlisted. The hidden videos appear to be migrated ones, to object storage. This is very confusing and i am not sure how to address this problem at the moment.
Hi, thanks for your reply!
I couldn’t reproduce the exact error this morning and am not sure what’s different… only last thing i’ve tried yesterday was removing and re-adding the base_urls as far as i recall.
it looks like the hidden videos are the ones that are pending for migration
Hmm, in order to find a fix for that, i have found and tried the following:
proxy_pass_request_headers on;
proxy_set_header Range $slice_range;
proxy_force_ranges on;
proxy_http_version 1.1;
for Firefox, this doesn’t do the trick. Curiously in Vivaldi however it looks like it is working. Very strange. For Firefox, it is also not helping to jump into a private tab.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
<Code>AccessDenied</Code>
<Message>This CORS request is not allowed. See https://www.backblaze.com/b2/docs/cors_rules.html.</Message>
</Error>
Now also Firefox works with Peertube again (still confused why Vivaldi worked).
Now, only thing left is the hidden videos from user channels, but maybe thats worth a bugreport / feature request on Github?
Will mark this as solution anyway, because this possibly was the most disruptive issue. Thanks again!
Could it be related to a v5.0.0 upgrade?
There is a migration script to move files for hidden/private videos. Have you launch it after upgrade? (see v5.0.0 changelog)
PS: I don’t know if S3 storage is concerned by this upgrade script, I never take a look how S3 integration works in Peertube. I’m just asking to help find the problem.
Hi, yes, i have first updated to v5 and also ran dist/scripts/migrations/peertube-5.0.js. I have initiated the move to object storage afterwards. But thanks for the suggestion!
…however this might be a misunderstanding: the videos that are not visible on user channels (at least?) are configured to be publicly visible, however it looks like they are the ones pending for migration to object storage.
Will try to report this to the repo soon.