Hi, I’m trying to enable S3 backups to a Min.IO server. When I change app.yml to what I think reflects the documentation, then rebuild, on completion all I get in the browser is the 4 coloured dots in the middle of the screen. When I look in the console I get;
Uncaught ReferenceError: I18n is not defined
Uncaught ReferenceError: I18n is not defined
On the Min server I have the region set up, then a public bucket called ‘assets’, then a private bucket called ‘discourse-data’, and obviously credentials to match. I’ve tried without quotes around the variables just in case because some of the examples do this - no change.
If I change these and restart, they don’t seem to take. I need to do a rebuild for them to activate which makes the testing cycle pretty painful. Would be a little easier if these fields were all available in the admin settings, which they seem to have been historically, or at least they appear on some people’s screen grabs (?)
If I comment out all the _S3 entries in app.yml and rebuild, it works fine. (I just don’t have backups configured) (the ENDPOINT and CDN url’s do resolve locally to the right IP)
Getting everything else set up, including subscriptions, was all relatively easy, but I’ve hit a brick wall with this. Anyone any idea what I’m doing wrong?
Hi, thanks for that, I’m about to try two things then;
Rebuild with ACCESS, SECRET and BACKUP_BUCKET (and I’m assuming endpoint?)
Trying to add the rake tasks and rebuild
You’re right in that I only wanted the data initially, but probably would have progresses to assets once something was working.
That all said, my (very poor) interpretation of the documentation rendering the site as effectively dead, seems potentially problematic for newbies. I’m not sure why the console is reporting I18n as an issue, but it looks like a minor mod in the code something like;
if (I18n && I18n.xxx)
Might protect newbies from killing their sites … should I trawl and try to make a PR, or is this something someone with more expertise might look at? Happy to have a go, but don’t want to waste my time if it’s not useful … ?
Mmm, Ok, made a little progress, the stripped down settings now allow the page to render, however I’m now getting a ‘bad request’ back from the server. I’m testing the S3 storage from the discourse machine using Min.io’s “mc” tool and it seems to work fine and I can list buckets … however in the logs I’m getting;
Failed to list backups from S3: Aws::S3::Errors::BadRequest
/var/www/discourse/lib/backup_restore/s3_backup_store.rb:140:in `rescue in unsorted_files'
I made a point to copy/paste the settings from app.yml into the “mc” config to make sure there were no typo’s … so I’m at a bit of a lostt for a second. Might have another go tomorrow …
It’s trying to list the contents of the bucket.
You do not need the rake task that has to do with assets.
Ok, thanks for your help, I did spot that, however it’s not really helping. I’ve tried Min.io and I’ve tried SeaweedFS, both I’ve configured up locally to the point where I’ve been able to write a file to S3 using a command line tool from the Discourse machine, neither option seems to want to play ball from within Discourse. After reviewing time-spent, I guess if backups are online and S3 I can see how the option to backup directly to S3 is great, however if your backups are “off cloud”, and you need to emulate S3 storage just to use the option, for me it’s become a little too expensive in terms of time.
Incidentally, I notice someone saying that CloudFlare S3 now works, which might be good for some people. CloudFlare seem to have added 10G of S3 to their free tier, however for me my backups are typically off-cloud on a Borg backup server.
What I’ve done instead is to add the discourse host machine to my backup VPN, installed borg and borgmatic covering /var/discourse/shared/standalone/backups and /var/discourse/shared/standalone/log on the host, then added this to cron 30 mins after the local backup is schedules.
Q: Cloud you clarify whether the local backups cover everything, or do I need more to cover uploads? (are the additional rake tasks just for S3?)
My paranoid self just doesn’t trust cloud providers with both live systems AND backups. Every time I think that maybe I worry too much, I remind myself of the time I turned up to a customer site in response to my server isn’t working to find that it had been struck by lightening - inside the server room.
Did you follow the minio-specific instructions here?
Yes I did. I’m quite happy to admit I may have made mistakes and not read / retained everything, but googling for appropriate docs wasn’t one of them …
./launcher destroy app;./launcher start app
Ok, that’s useful for future reference, I was trying stop / start, not all that familiar with how docker builds env vars on boot.
If you’re going to put assets there and not just backups, then don’t miss the rake task that pushes assets there.
Sure, that was the bit that I was a little confused about, I’ll add them. Was just wondering why these wouldn’t be part of the default backup, I know there is a space issue, but my expectation would be that in general people want a backup of all of their content? (and as most people don’t seem to verify their contents, err’ing on the side of everything maybe safer?)
Hmm, I tried it on my test instance first (!) … I cut and pasted two lines fron the docs … is something out of date somewhere?
I, [2023-09-04T18:39:51.544973 #1] INFO -- : > cd /var/www/discourse/plugins && sudo -E -u discourse bundle exec rake s3:upload_assets
bundler: failed to load command: rake (/var/www/discourse/vendor/bundle/ruby/3.2.0/bin/rake)
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/definition.rb:524:in `materialize': Could not find css_parser-1.16.0, oj-3.16.1, rotp-6.3.0, globalid-1.2.0, google-protobuf-3.24.2-x86_64-linux in locally installed gems (Bundler::GemNotFound)
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/definition.rb:197:in `specs'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/definition.rb:254:in `specs_for'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/runtime.rb:18:in `setup'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler.rb:162:in `setup'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/setup.rb:23:in `block in <top (required)>'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/ui/shell.rb:159:in `with_level'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/ui/shell.rb:111:in `silence'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/setup.rb:23:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:56:in `require_relative'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:56:in `kernel_load'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:34:in `dispatch'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:28:in `start'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
from /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>'
from /usr/local/bin/bundle:25:in `load'
from /usr/local/bin/bundle:25:in `<main>'
I, [2023-09-04T18:39:52.163459 #1] INFO -- :
I, [2023-09-04T18:39:52.164462 #1] INFO -- : Terminating async processes
If your uploads are are on S3 then you’re counting on the S3 manager to make it work so you don’t need backups. There’s a hidden settign to download assets from S3 and include them in the backup, but you almost certainliy don’t want to do that.