Changed container volume paths in app.yml, can't find site data

(AstonJ) #1

Made some changes to app.yml and ran ./launcher rebuild app but it has wiped my install and left me with a default Discourse install.

Any ideas why this might have happened? : /

The shared/standalone/backups/ directory has vanished too : - (

(Could it be related to this How can I delete and start again?)

(Mittineague) #2

I’m far from being an expert in this, but
Did you validate the yml file after you changed it?

If so, I think it might help to post exactly what changes you made.

(AstonJ) #3

What do you mean by validate the yml file?

I don’t think it was the yml file tbh, as I just started back on this: Reply by email SSL self signed certificate error but basically I added this to the end of the app.yml file:

 - file:
     path: /tmp/add-cert
     chmod: +x
     contents: |
       #!/bin/bash -e
       #Download cert
       wget -O - > /usr/local/share/ca-certificates/aston-email.cert

 - exec: "/tmp/add-cert"

I think it’s more to do with how I ‘started afresh’ in the other thread.

This time I am removing Docker completely (and all its containers) and starting again.

Also interestingly, my daily backup of my sites home folders does not have the shared/standalone/backups folder in it.

(Mittineague) #4

Using this (or others)

The example you posted validates, so it must be something beyond my knowledge level causing a problem.

(Kane York) #5

Uh, so it wasn’t the rebuild that wiped it, it was you deleting the database that wiped it.It continued to function due to a quirk in Linux where files aren’t really deleted until no process is looking at them anymore. But because you also removed the backups folder, the backups were also failing.

So congratulations, people handed you the fully-loaded gun you asked for, and you proceeded to shoot yourself in the foot.

(AstonJ) #6

I don’t think that was it. Looking back now when I moved to this server I changed these paths:

## These containers are stateless, all data is stored in /shared
  - volume:
      host: /home/metaruby/apps/discourse/shared/standalone
      guest: /home/metaruby/apps/shared
  - volume:
      host: /home/metaruby/apps/discourse/shared/standalone/log/var-log
      guest: /home/metaruby/apps/log

On the original server I only changed the two ‘host’ lines, on this one I changed the ‘guest’ lines to what’s above - and I think this is what broke it.

The reason I installed into /home/metaruby is because on my server all sites are in their own folders inside the home directory.

(Jeff Atwood) #7

So if you changed the data paths, the old data paths should still be there with the databases you are looking for.

(AstonJ) #8

That’s what I would have thought - but there was nothing there in /home/metaruby/apps/shared

I’ve changed the ‘guest’ lines back to the original now.

Part of the reason I did this is because I want to install another Discourse forum on this server - is it ok if the ‘guest’ lines are the same for each install?

(Kane York) #9

Yes, guest means inside of the container, what you get after ./launcher enter app.

(AstonJ) #10

Thanks all - it’s back up now, though I had to use an earlier backup so we’ve lost 12 days of posts and members : - (

My backups of the backups didn’t work either because the backups weren’t there in the first place.

I am going to ./launcher rebuild app now just to make sure it doesn’t go awry again! Edit: it was fine- phew!

(Sam Saffron) #11

Nothing should ever wipe out stuff, all data is stored outside the container, worst you can do is leave PG data in a random directory on the drive.

Search through your drive, it should be there.

(AstonJ) #12

It’s not Sam : -(

I downloaded a copy of the apps folder before restoring and searching for metaruby only returns the app.yml file (Discourse names my backups metaruby-ruby-forum-2015-08-10-000912.tar.gz etc).

I also restored the Virtualmin account for the domain and it wasn’t there either. (The account restore restores everything in the /home/metaruby directory as well as emails and other domain specific settings).

I have a feeling it was either me changing those paths, or starting over incorrectly as per that thread (though I have upgraded several times since - so it’s all a bit odd really).

(Sam Saffron) #13

Did you do a search from / ? Search for a file named PG_VERSION recursively from root as root.

(AstonJ) #14

Do you mean like this Sam?

# locate PG_VERSION
# find -name "PG_VERSION"
# find

Would it have been inside /var/lib/docker? I ended up removing that after I wanted to reinstall Docker to be on the safe side.

(AstonJ) #15

Just downloaded last nights backup, and there’s no backups folder in shared/standalone either:

Edit: Here is last nights backup (so of the new install) note that the backups are there:

(AstonJ) #16

Hi @sam I just remembered that I copied var/lib/docker before deleting it :slight_smile: will the Discourse db/backup/data be in the container anywhere? I’ve looked but can’t see anything…

I’ve also got a copy of the home directory (as per first screen shot in the previous post) so should the DB be there anywhere?

Otherwise any idea how it was possible that my forum was still running (and I did several upgrades) without other issues? Could it be what @riking said (about deleted linux files - but then the upgrades worked fine).