Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database.php missing in latest docker images #1297

Closed
thegm90 opened this issue May 8, 2017 · 25 comments
Closed

database.php missing in latest docker images #1297

thegm90 opened this issue May 8, 2017 · 25 comments
Assignees
Labels
Milestone

Comments

@thegm90
Copy link

thegm90 commented May 8, 2017

What does everyone else like to use for database back ups? We are using digital ocean on a linux image.

@thegm90 thegm90 changed the title What is your preferred method for backing up the database? #Question What is your preferred method for backing up the database? ###Question May 8, 2017
@odiea
Copy link
Collaborator

odiea commented May 8, 2017

I use xampp so I use the export feature in phpMyAdmin.

@SteveIreland
Copy link
Collaborator

Does anyone use the backup button that's in general config? Are there issues with it?

@thegm90
Copy link
Author

thegm90 commented May 9, 2017

Whaaaat?! That's in the app?! Where within is it?

@SteveIreland
Copy link
Collaborator

It's in the Configuration module under the General configuration tab .... last button at the bottom of the page.

I haven't yet tried to recreate a database from one, but it looks like the normal MySQL backup format. I'd be interested to know if anyone has used it to recover or migrate their database.

@thegm90
Copy link
Author

thegm90 commented May 9, 2017

I volunteer as tribute :) we are still trying to update to fix the tax / profit issue I mentioned a few weeks back.

Will report back!

@thegm90
Copy link
Author

thegm90 commented May 9, 2017

Gave us a full backup with the button(hurray!). We just need to figure out how to execute this back on top of the update.

Is their a preferred method to restore a database back onto digital ocean?

@thegm90
Copy link
Author

thegm90 commented May 10, 2017

Did the download, figured out getting the DB on, and if you look at the attached, this is what we are seeing now. If you look at the lines running, you can see the database. Is there database differences from 3.1.0 to the new releaser(that fixes the tax issue)?

screen shot 2017-05-09 at 11 36 56 pm

@SteveIreland
Copy link
Collaborator

It hasn't yet been set in stone, but I believe that the intent is to include the migration in the 3.1.0 release when deemed final.

The pull request does not introduce any database changes except the migration table that is automatically added by the migration module to keep track of the last migration that was run.

@themichaelmitchell
Copy link

@SteveIreland I am helping @thegm90 with the this (I'm his brother). Thank you for your help so far!

Currently running the latest from master (c4a76ad) in a docker environment.

Backed up the database, completely nuked the server, and started fresh from that commit above. Built it and up'd it, the website reveals a database error seen in the below picture. Issues #294 and #303 had similar issues but there wasn't much info that helped (use the latest master and read the readme).

Is there something that we're suddenly doing wrong? Is there a specific commit that we should be cloning from instead of master?

Thank you for all your help (everyone!), we appreciate it a bunch!

image

@SteveIreland
Copy link
Collaborator

I downloaded and installed that commit level of OSPOS into WAMP and it kicked it off without any problems. I'm not yet familiar with the installation tools so if there is an issue where it's not setting up the correct configuration (which is what it sounds like) I can't help. It sounds like a base reference issue of some type.

The two issues that you referenced were for a specific issue in a specific release back in January 2016 which was resolved way back then, So I doubt if it's the same issue - but it will probably be similar. If you can identify what was changed back when it was fixed it might provide a clue as to what needs to be corrected.

@themichaelmitchell
Copy link

If it helps, here is the docker-compose up result:

Pastebin

@jekkos
Copy link
Member

jekkos commented May 12, 2017

There might be an issue with the database.php file inside the php container not having the correct file permissions set.

Can you go into the php container as follows

docker exec -ti opensourccepos_php_1 /bin/bash

then check file permissions on database.php

ls -la /app/application/config/database.php

does it have the same owner as other filies?

@jekkos
Copy link
Member

jekkos commented May 12, 2017

Otherwise you can mount a local database.php into the container to replace it, however I'm not sure what effect that willl give on the readability by the containerized apache process

@themichaelmitchell
Copy link

@jekkos Thanks a ton for the reply! Poked around in the php container and the database.php file didn't even exist!? Super weird. Checked the ~/github/opensourcepos/application/config folder and database.php existed there. I nuked all the images and containers, recloned the repo, rebuilt the containers, checked the php container again and same thing.

Since all other config files exist in the directory, I'm assuming this line runs just fine...

Are you able to recreate this issue? Below is a screenshot of the config dir immediately after the php container is spun up. No trickery, pinky promise.

image

@themichaelmitchell
Copy link

themichaelmitchell commented May 12, 2017

@jekkos You mentioned mounting the file, do you mean creating a volume directly to the application/config/database.php file from the existing database.php file?

Welp, got it to come up - question is why the database.php file gets destroyed in the first place. Are there logs somewhere in the container/host that would reveal something here?

For those joining us in the future--
I have temp fixed the issue doing the following:
docker cp ~/path/application/config/database.php opensourcepos_php_1:/app/application/config
docker exec -it opensourcepos_php_1 chown -R www-data:www-data /app/public /app/application
docker-compose stop
docker-compose start
This copied the sneaky database.php file into the container then set the permissions so apache could read it, then restarted the container. Pretty sure this is a temp fix.

Afterwards:
image

@jekkos
Copy link
Member

jekkos commented May 12, 2017

Hi yes I was just looking into this. Actually previously the database.php was copied during the initial docker image construction using docker cp. This line was removed as the database.php is supposed to be used as it is in the codebase without further modification. This thanks to the dotenv integration I did recently.

However I don't understand why it's not copied from the source during initial image construction. In fact after every commit travis rebuilds the container and pushes it to docker hub. Need to check where this went wrong exac

@jekkos jekkos self-assigned this May 12, 2017
@jekkos jekkos added the bug label May 12, 2017
@jekkos jekkos changed the title What is your preferred method for backing up the database? ###Question database.php missing in latest docker images May 12, 2017
@themichaelmitchell
Copy link

themichaelmitchell commented May 12, 2017

Ah, I see that commit now (2814118). Thanks for looking into it! Is there any info that I can provide to help out?

@thegm90
Copy link
Author

thegm90 commented May 21, 2017

Wanted to check in with you guys and see if there are any developments with the database.php?

@jekkos
Copy link
Member

jekkos commented May 24, 2017

I checked my latest conrtainer and it does have database.php in it. Did you try remove and redownload the container from docker hub? Do a docker rmi -f jekkos/opensourcepos and then compose up again to see if that resolves the issue?

@daN4cat daN4cat assigned thegm90 and unassigned jekkos May 27, 2017
@daN4cat daN4cat added this to the 3.1.0 milestone May 27, 2017
@themichaelmitchell
Copy link

themichaelmitchell commented May 27, 2017

Apologies on the delay. After wiping clean the web server (docker rmi $(docker images) and docker system purge), recloning the github project, rebuilding and upping the containers, the database file appears to still be missing. Is there further info that I can provide that could help?

@jekkos
Copy link
Member

jekkos commented May 29, 2017

Ok the dev container does seem to have the file. It might be the regular one that has it missing. I'll check later this week.

@jekkos jekkos removed the pending label May 29, 2017
@jekkos jekkos self-assigned this May 29, 2017
@thegm90
Copy link
Author

thegm90 commented Jun 5, 2017

Hey Jekkos, any news on your findings?

@jekkos
Copy link
Member

jekkos commented Jun 7, 2017

I had another short look and indeed, the file is not in the container, didn't directly understand why. Will need to find some more time to investigate further.

@jekkos
Copy link
Member

jekkos commented Jun 13, 2017

Should be fixed now @thegm90. Can you verify? Thanks!

@diranetafen
Copy link

HI @jekkos , I was facing the same issue ( database.php missing in latest docker images) last week, after your update all is OK now Thanks !

@jekkos jekkos closed this as completed Jun 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants