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

setup-hangs-fails-at-final-step-3 #1572

Open
dkebler opened this issue Mar 27, 2015 · 13 comments
Open

setup-hangs-fails-at-final-step-3 #1572

dkebler opened this issue Mar 27, 2015 · 13 comments

Comments

@dkebler
Copy link

dkebler commented Mar 27, 2015

Having the same problem as this person
http://superuser.com/questions/777811/trovebox-openphoto-setup-hangs-fails-at-final-step-3

Followed all the advice. Yours, the "good" answer.

Used your 3 minute script on ubuntu 14.04 with latest Apache and Php5.
Phpinfo confirms mcrypt loaded.
ownership good on three directories set in script
all good with databse, recreated it and user to be sure.
(have serveral other mysql/php based installs including recent wordpress)

From apache logs:Doesn't seem to be getting the info from put in to page 2.
No errors in mysql log because of missing variable values I suppose

[Fri Mar 27 00:54:07.111737 2015] [:error] [pid 17430] [client 75.142.157.70:35005] PHP Notice:  Undefined variable: mySqlHost in /var/www/openphoto/src/templates/setup.php on line 99, referer: http://photos.duranguito.org/setup/2
[Fri Mar 27 00:54:07.111770 2015] [:error] [pid 17430] [client 75.142.157.70:35005] PHP Notice:  Undefined variable: mySqlUser in /var/www/openphoto/src/templates/setup.php on line 102, referer: http://photos.duranguito.org/setup/2
[Fri Mar 27 00:54:07.111784 2015] [:error] [pid 17430] [client 75.142.157.70:35005] PHP Notice:  Undefined variable: mySqlPassword in /var/www/openphoto/src/templates/setup.php on line 105, referer: http://photos.duranguito.org/setup/2
[Fri Mar 27 00:54:07.111798 2015] [:error] [pid 17430] [client 75.142.157.70:35005] PHP Notice:  Undefined variable: mySqlDb in /var/www/openphoto/src/templates/setup.php on line 108, referer: http://photos.duranguito.org/setup/2
[Fri Mar 27 00:54:07.111811 2015] [:error] [pid 17430] [client 75.142.157.70:35005] PHP Notice:  Undefined variable: mySqlTablePrefix in /var/www/openphoto/src/templates/setup.php on line 111, referer: http://photos.duranguito.org
@dkebler
Copy link
Author

dkebler commented Mar 27, 2015

All other than the three directories set in the script are set root:root. Is that ok?
Deleted openphoto folder and reran the script without --quiet. All seems good. Issue persists.

If it makes any difference (why) this server is running on EC2

@nakedgun
Copy link

Most failures on this page are due to missing extensions (e.g. mcrypt, oauth) or failure to connect to MySQL. If localhost doesn't work, try 127.0.0.1. Ensure the DB is empty. If you're running MySQL on a non-standard port (e.g. not 3306), add this to the setup page.

Depending on your config, check php_error.log for any exceptions caught via EPI. This will include enough information to troubleshoot the cause of failure.

@dkebler
Copy link
Author

dkebler commented Mar 28, 2015

(e.g. mcrypt, oauth)
both loaded confirmed by phpinfo and looking in php5 directory

or failure to connect to MySQL. If localhost doesn't work, try 127.0.0.1.
tried both, I use localhost in all my other php/msql installs and that
works.

Ensure the DB is empty.
checked.

running on standard port

If you're running MySQL on a non-standard port (e.g. not 3306), add this
to the setup page.

Depending on your config, check php_error.log for any exceptions caught
via EPI. This will include enough information to troubleshoot the cause of
failure.

errors below but above this are the errors I already shared which indicate
that that the database values are not getting lifted from the form on
page two
and or not getting written before getting used to create the
database tables. This is confirmed by these errors where FROM in sql has no
value. Am I having a write permission problem? I checked userdata and
userdata/config folder has owner:group www-data:www-data

This is becoming a time suck. Can I just do this manually? I see a
template.ini in configs folder. If I fill that out to what name/where do I
save it (userdata/config?) ? How do I run the sql statement to generate
the tables? then how to to turn off the setup pages from loading?

As I mentioned I have several other apache/php/mysql web app installs on
this server with no write/install issues including wordpress.

*Notice*: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value
1, value 2 will be used instead in
*/var/www/openphoto/src/libraries/external/aws/lib/requestcore/requestcore.class.php*
on line *613*

*Notice*: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value
1, value 2 will be used instead in
*/var/www/openphoto/src/libraries/external/aws/lib/requestcore/requestcore.class.php*
on line *613*

*Fatal error*: Uncaught exception 'EpiDatabaseQueryException' with message
'Query error: SQLSTATE[42S02]: Base table or view not found: 1146 Table
'trovebox.user' doesn't exist - SELECT * FROM `user` WHERE `id`=:owner ' in
/var/www/openphoto/src/libraries/external/epi/EpiException.php:13 Stack
trace: #0
/var/www/openphoto/src/libraries/external/epi/EpiDatabase.php(120):
EpiException::raise(Object(EpiDatabaseQueryException)) #1
/var/www/openphoto/src/libraries/external/epi/EpiDatabase.php(79):
EpiDatabase->prepare('SELECT * FROM `...', Array) #2
/var/www/openphoto/src/libraries/adapters/DatabaseMySql.php(922):
EpiDatabase->one('SELECT * FROM `...', Array) #3
/var/www/openphoto/src/libraries/models/User.php(246):
DatabaseMySql->getUser('admin@duranguit...') #4
/var/www/openphoto/src/libraries/models/User.php(159):
User->getUserByEmail('admin@duranguit...') #5
/var/www/openphoto/src/html/assets/themes/fabrizio1.0/templates/partials/titles.php(9):
User->getNameFromEmail('admin@duranguit...') #6
/var/www/openphoto/src/libraries/ in
*/var/www/openphoto/src/libraries/external/epi/EpiException.php* on line
*13

@nakedgun
Copy link

With your preferred MySQL tool, connect to the EC2 DB from your machine using the same credentials and database. Drop any existing tables which exist. Try creating a table to verify permissions. If all is good, setup should work. However, the manual approach, should all else fail:

Can I just do this manually? I see a
template.ini in configs folder. If I fill that out to what name/where do I
save it (userdata/config?) ? How do I run the sql statement to generate
the tables? then how to to turn off the setup pages from loading?

  1. On local dev, do the install, SQL dump the database and backup /userdata/configs/%host%.ini .
  2. Copy this file to the EC2 instance and rename %host% to match the server's hostname.
  3. Import the SQL database and the setup process will be bypassed.

For this to work, MySQL credentials on dev/ec2 need to match, since they're written encrypted in site.ini

@dkebler
Copy link
Author

dkebler commented Mar 29, 2015

don't have a local lamp installed. No SQL available to generate database?

On Sat, Mar 28, 2015 at 10:56 AM, nakedgun notifications@github.com wrote:

With your preferred MySQL tool, connect to the EC2 DB from your machine
using the same credentials and database. Drop any existing tables which
exist. Try creating a table to verify permissions. If all is good, setup
should work. However, the manual approach, should all else fail:

Can I just do this manually? I see a template.ini in configs folder. If I
fill that out to what name/where do I save it (userdata/config?) ? How do I
run the sql statement to generate the tables? then how to to turn off the
setup pages from loading?

  1. On local dev, do the install, SQL dump the database and backup
    /userdata/configs/%host%.ini .
  2. Copy this file to the EC2 instance and rename %host% to match the
    server's hostname.
  3. Import the SQL database and the setup process will be bypassed.

For this to work, MySQL credentials on dev/ec2 need to match, since
they're written encrypted in site.ini


Reply to this email directly or view it on GitHub
#1572 (comment).

Cheers, Cuidate, TTFN http://www.youtube.com/watch?v=5Gu50vq5ux4
David

@dkebler
Copy link
Author

dkebler commented Mar 29, 2015

ok, did a local lamp install. Now database tables are created but page 3
gives 500 error and no ini file written in /userdata/configs

beyond mysql and S3 entries what else needs to be filled in in the
template.ini

Honestly, not very confident that trovebox will work once I follow your
last instructions given this install is pretty much a failure. Any
thoughts on why? Some particular issue with Ubuntu lamp?

On Sun, Mar 29, 2015 at 7:11 AM, David Kebler d@kebler.net wrote:

don't have a local lamp installed. No SQL available to generate database?

On Sat, Mar 28, 2015 at 10:56 AM, nakedgun notifications@github.com
wrote:

With your preferred MySQL tool, connect to the EC2 DB from your machine
using the same credentials and database. Drop any existing tables which
exist. Try creating a table to verify permissions. If all is good, setup
should work. However, the manual approach, should all else fail:

Can I just do this manually? I see a template.ini in configs folder. If
I fill that out to what name/where do I save it (userdata/config?) ? How do
I run the sql statement to generate the tables? then how to to turn off the
setup pages from loading?

  1. On local dev, do the install, SQL dump the database and backup
    /userdata/configs/%host%.ini .
  2. Copy this file to the EC2 instance and rename %host% to match the
    server's hostname.
  3. Import the SQL database and the setup process will be bypassed.

For this to work, MySQL credentials on dev/ec2 need to match, since
they're written encrypted in site.ini


Reply to this email directly or view it on GitHub
#1572 (comment).

Cheers, Cuidate, TTFN http://www.youtube.com/watch?v=5Gu50vq5ux4
David

Cheers, Cuidate, TTFN http://www.youtube.com/watch?v=5Gu50vq5ux4
David

@jmathai
Copy link
Member

jmathai commented Mar 31, 2015

@dkebler what's in your error log when you receive the 500?

@gr8tushar
Copy link

@dkebler hi, I am also facing the same issue. Did you find a solution to that ?

@russmac
Copy link

russmac commented May 9, 2015

The setup script does not enable mycrpt.so , (fixed)

With the DB user in question having complete access. setup fails.

"127.0.0.1 | root | *0F95AFF51ASDFFASDAEASFHFASHF4D97675A0117 | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y "

The database setup, appears to fails due to the user table not existing. Before its actually created.

"Table 'photos.user' doesn't exist - SELECT * FROM user WHERE id=:owner '"

[Sat May 09 03:32:20.921745 2015] [:error] [pid 26625] [client 10.0.0.7:17986] PHP Fatal error: Uncaught exception 'EpiDatabaseQueryException' with message 'Query error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'photos.user' doesn't exist - SELECT * FROM user WHERE id=:owner ' in /var/www/openphoto/src/libraries/external/epi/EpiException.php:13\nStack trace:\n#0 /var/www/openphoto/src/libraries/external/epi/EpiDatabase.php(120): EpiException::raise(Object(EpiDatabaseQueryException))\n#1 /var/www/openphoto/src/libraries/external/epi/EpiDatabase.php(79): EpiDatabase->prepare('SELECT * FROM ...', Array)\n#2 /var/www/openphoto/src/libraries/adapters/DatabaseMySql.php(922): EpiDatabase->one('SELECT * FROM...', Array)\n#3 /var/www/openphoto/src/libraries/models/User.php(246): DatabaseMySql->getUser('russmac@interno...')\n#4 /var/www/openphoto/src/libraries/models/User.php(159): User->getUserByEmail('private@interno...')\n#5 /var/www/openphoto/src/html/assets/themes/fabrizio1.0/templates/partials/titles.php(9): User->getNameFromEmail('russmac@interno...')\n#6 /var/www/openphoto/src/libraries/ex in /var/www/openphoto/src/libraries/external/epi/EpiException.php on line 13, referer: http://photo.private.net/setup/3

Ive been looking everywhere for some SQL to create it manually.

@russmac
Copy link

russmac commented May 9, 2015

Solution ( Tested once, Then reproduced succesfully again )

create a user.sql file with these contents.

CREATE TABLE IF NOT EXISTS user (
id varchar(255) NOT NULL COMMENT 'User''s email address',
password varchar(64) NOT NULL,
extra text NOT NULL,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

create db user table, prompt for password

mysql newblankdatabasename < user.sql -p

Now enter this as the database in your user setup and setup will complete succesfully.

@russmac
Copy link

russmac commented May 9, 2015

@jmathai
Copy link
Member

jmathai commented May 18, 2015

Would like to better understand the issue here. It looks like it fails at 'User::getNameFromEmail()` which shouldn't be called yet (I don't think). It should only be called if you have a session and you shouldn't yet in the setup unless.

Can you confirm if this error came up after you already tried to set Trovebox up unsuccessfully?

@youphyun
Copy link

Yes I can confirm that if the setup fails subsequent tries with the same e-mail address will also fail. The only way is to manually delete the user entry from the mysql database or try again with a different e-mail address:


[Tue May 26 16:27:46.643249 2015] [:error] [pid 27686] [client x.x.x.x:60662] {severity:warn, description:"Query error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'name@domain.com' for key 'PRIMARY' - INSERT INTO `user` (`id`,`password`,`extra`) VALUES (:id,:password,:extra)", additional:}, referer: http://x.x.x.x/setup/3 ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants