incf-nidash / nidm-training

Training materials for learning NIDM
1 stars 14 forks source link

Could not restore database using prefix virtuoso_db_full1.bp #14

Closed nicholsn closed 8 years ago

nicholsn commented 8 years ago

@dbkeator, I have the vm up and running and could access the conductor, but can seem to restore the db.

So here is what I'm seeing when I try to restore the db... does it work for you?

vagrant@vagrant-ubuntu-trusty-64:/var/lib/virtuoso-opensource-7/db$ sudo virtuoso-t +restore-backup virtuoso_db_full1.bp

        Thu Oct 22 2015
01:08:23 { Loading plugin 1: Type `plain', file `wikiv' in `/usr/lib/virtuoso-opensource-7/hosting'
01:08:23   FAILED  plugin 1: Unable to locate file }
01:08:23 { Loading plugin 2: Type `plain', file `mediawiki' in `/usr/lib/virtuoso-opensource-7/hosting'
01:08:23   FAILED  plugin 2: Unable to locate file }
01:08:23 { Loading plugin 3: Type `plain', file `creolewiki' in `/usr/lib/virtuoso-opensource-7/hosting'
01:08:23   FAILED  plugin 3: Unable to locate file }
01:08:23 OpenLink Virtuoso Universal Server
01:08:23 Version 07.20.3212-pthreads for Linux as of Feb 15 2015
01:08:23 uses parts of OpenSSL, PCRE, Html Tidy
01:08:23 Could not restore database using prefix virtuoso_db_full1.bp
01:08:23 Server exiting
dbkeator commented 8 years ago

So I did have some trouble restoring the database. The process I used was:

Can you try this exact set of commands? I noticed your restore command is different than the 1 above (i.e. don't include the "1.bp"). Also sudo su (I know sudo command should be the same thing but let's just try what worked for me exactly).

dbkeator commented 8 years ago

Typo, commands should be: Type "sudo vagrant ssh" Type "sudo su" Type "cd /var/lib/virtuoso-opensource-7/db" Type "cp /vagrant/virtuoso-backup/virtuoso_db_full1.bp ." Type "isql" Type "shutdown();" Quit isql Type "rm virtuoso.db" Type "virtuoso-t +restore-backup virtuoso_db_full"

I just did it again, results below. Seems to work with the typos fixed:

Keator-Laptop:nidm_virtuoso_demo dbkeator$ sudo vagrant ssh Password: Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-45-generic x86_64)

185 packages can be updated. 91 updates are security updates.

Last login: Thu Oct 22 01:48:29 2015 from 10.0.2.2 vagrant@vagrant-ubuntu-trusty-64:~$ sudo su root@vagrant-ubuntu-trusty-64:/home/vagrant# cd /var/lib/virtuoso-opensource-7/db/ root@vagrant-ubuntu-trusty-64:/var/lib/virtuoso-opensource-7/db# cp /vagrant/virtuoso_backup/virtuoso_db_full1.bp . root@vagrant-ubuntu-trusty-64:/var/lib/virtuoso-opensource-7/db# isql OpenLink Interactive SQL (Virtuoso), version 0.9849b. Type HELP; for help and EXIT; to exit. SQL> shutdown();

*\ Error S2801: [Virtuoso Driver]CL033: Connect failed to localhost:1111 = localhost:1111. at line 1 of Top-Level: shutdown() root@vagrant-ubuntu-trusty-64:/var/lib/virtuoso-opensource-7/db# rm virtuoso.db root@vagrant-ubuntu-trusty-64:/var/lib/virtuoso-opensource-7/db# ls virtuoso_db_full1.bp virtuoso.ini virtuoso.log virtuoso.pxa virtuoso-temp.db virtuoso.trx root@vagrant-ubuntu-trusty-64:/var/lib/virtuoso-opensource-7/db# virtuoso-t +restore-backup virtuoso_db_full

    Thu Oct 22 2015

01:55:41 { Loading plugin 1: Type plain', filewikiv' in /usr/lib/virtuoso-opensource-7/hosting' 01:55:41 FAILED plugin 1: Unable to locate file } 01:55:41 { Loading plugin 2: Typeplain', file mediawiki' in/usr/lib/virtuoso-opensource-7/hosting' 01:55:41 FAILED plugin 2: Unable to locate file } 01:55:41 { Loading plugin 3: Type plain', filecreolewiki' in `/usr/lib/virtuoso-opensource-7/hosting' 01:55:41 FAILED plugin 3: Unable to locate file } 01:55:41 OpenLink Virtuoso Universal Server 01:55:41 Version 07.20.3212-pthreads for Linux as of Feb 15 2015 01:55:41 uses parts of OpenSSL, PCRE, Html Tidy 01:55:41 Begin to restore with file prefix virtuoso_db_full 01:55:41 --> Backup file # 1 [0x3779-0xDE-0x2E] 01:55:41 End of restoring from backup, 4774 pages 01:55:41 Server exiting root@vagrant-ubuntu-trusty-64:/var/lib/virtuoso-opensource-7/db# virtuoso-t -f & [1] 12718

nicholsn commented 8 years ago

Great, so now I have the database restored, thanks! Now to access the app, what do I need to do?

When I visit http://127.0.0.1:4567/ I just get a 404 error from apache. Is there a separate app I need to start?

dbkeator commented 8 years ago

Hmm, that's all you should need to do.

Maybe make sure the DocumentRoot is set to /var/www/demo in /etc/apache2/sites-available/000-default.conf and then restart apache (apachectl -k restart) ...all as root in the vagrant vm of course... Actually now that I think about it, apache is installed fresh for you so you'll need to set the DocumentRoot in the apache configuration. Will add this to the instructions....

nicholsn commented 8 years ago

Yup, the document root was the issue. Now I have the app up, but not seeing results from the queries. I can log into virtuoso and see that the database is populated. Thoughts?

app
dbkeator commented 8 years ago

Never seen that. Do you see the drop downs populated? For example, the Human Brain Segmentations dropdown should have a list of the anatomical regions from freesurfer. If it doesn't then that means your DB hasn't been restored.

nicholsn commented 8 years ago

Nope, no drop downs being populated. When I check the logs, this is what I get:

root@vagrant-ubuntu-trusty-64:/etc/apache2/sites-available# cat /var/log/apache2/error.log
[Mon Oct 26 18:57:07.005932 2015] [mpm_event:notice] [pid 2405:tid 139925463775104] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Oct 26 18:57:07.006004 2015] [core:notice] [pid 2405:tid 139925463775104] AH00094: Command line: '/usr/sbin/apache2'
[Mon Oct 26 18:57:35.846614 2015] [mpm_event:notice] [pid 2405:tid 139925463775104] AH00491: caught SIGTERM, shutting down
[Mon Oct 26 18:57:36.891185 2015] [mpm_prefork:notice] [pid 5397] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Oct 26 18:57:36.891253 2015] [core:notice] [pid 5397] AH00094: Command line: '/usr/sbin/apache2'
[Mon Oct 26 18:57:38.083236 2015] [mpm_prefork:notice] [pid 5397] AH00169: caught SIGTERM, shutting down
[Mon Oct 26 18:57:39.218713 2015] [mpm_prefork:notice] [pid 5473] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.13 configured -- resuming normal operations
[Mon Oct 26 18:57:39.218760 2015] [core:notice] [pid 5473] AH00094: Command line: '/usr/sbin/apache2'
[Tue Oct 27 00:00:08.521037 2015] [mpm_prefork:notice] [pid 5473] AH00173: SIGHUP received.  Attempting to restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.2.15. Set the 'ServerName' directive globally to suppress this message
[Tue Oct 27 00:00:08.543505 2015] [mpm_prefork:notice] [pid 5473] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.13 configured -- resuming normal operations
[Tue Oct 27 00:00:08.543528 2015] [core:notice] [pid 5473] AH00094: Command line: '/usr/sbin/apache2'
[Tue Oct 27 00:20:52.897419 2015] [:error] [pid 7672] [client 10.0.2.2:55209] PHP Warning:  require(/var/www/demo/lib/rdf-db.php): failed to open stream: No such file or directory in /vagrant/demo/fetch-query-fields.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:20:52.897445 2015] [:error] [pid 7672] [client 10.0.2.2:55209] PHP Fatal error:  require(): Failed opening required '/var/www/demo/lib/rdf-db.php' (include_path='.:/usr/share/php:/usr/share/pear') in /vagrant/demo/fetch-query-fields.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:20:54.112114 2015] [:error] [pid 7671] [client 10.0.2.2:55222] PHP Warning:  require(/var/www/demo/lib/rdf-db.php): failed to open stream: No such file or directory in /vagrant/demo/fetch-anatomical-regions.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:20:54.112144 2015] [:error] [pid 7671] [client 10.0.2.2:55222] PHP Fatal error:  require(): Failed opening required '/var/www/demo/lib/rdf-db.php' (include_path='.:/usr/share/php:/usr/share/pear') in /vagrant/demo/fetch-anatomical-regions.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:20:55.447976 2015] [:error] [pid 7701] [client 10.0.2.2:55224] PHP Warning:  require(/var/www/demo/lib/rdf-db.php): failed to open stream: No such file or directory in /vagrant/demo/fetch-nidm-results.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:20:55.448005 2015] [:error] [pid 7701] [client 10.0.2.2:55224] PHP Fatal error:  require(): Failed opening required '/var/www/demo/lib/rdf-db.php' (include_path='.:/usr/share/php:/usr/share/pear') in /vagrant/demo/fetch-nidm-results.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:20:56.381909 2015] [:error] [pid 7703] [client 10.0.2.2:55226] PHP Warning:  require_once(/var/www/demo/lib/rdf-db.php): failed to open stream: No such file or directory in /vagrant/demo/fetch-mhr-stats.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:20:56.381943 2015] [:error] [pid 7703] [client 10.0.2.2:55226] PHP Fatal error:  require_once(): Failed opening required '/var/www/demo/lib/rdf-db.php' (include_path='.:/usr/share/php:/usr/share/pear') in /vagrant/demo/fetch-mhr-stats.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:21:20.815387 2015] [:error] [pid 7674] [client 10.0.2.2:55288] PHP Warning:  require(/var/www/demo/lib/rdf-db.php): failed to open stream: No such file or directory in /vagrant/demo/fetch-anatomical-regions.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:21:20.815426 2015] [:error] [pid 7674] [client 10.0.2.2:55288] PHP Fatal error:  require(): Failed opening required '/var/www/demo/lib/rdf-db.php' (include_path='.:/usr/share/php:/usr/share/pear') in /vagrant/demo/fetch-anatomical-regions.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:21:21.927985 2015] [:error] [pid 7675] [client 10.0.2.2:55290] PHP Warning:  require(/var/www/demo/lib/rdf-db.php): failed to open stream: No such file or directory in /vagrant/demo/fetch-query-fields.php on line 2, referer: http://localhost:4567/query.php
[Tue Oct 27 00:21:21.928013 2015] [:error] [pid 7675] [client 10.0.2.2:55290] PHP Fatal error:  require(): Failed opening required '/var/www/demo/lib/rdf-db.php' (include_path='.:/usr/share/php:/usr/share/pear') in /vagrant/demo/fetch-query-fields.php on line 2, referer: http://localhost:4567/query.php

Looking at the last error:

root@vagrant-ubuntu-trusty-64:/etc/apache2/sites-available# ls /vagrant/demo/fetch-query-fields.php
/vagrant/demo/fetch-query-fields.php
root@vagrant-ubuntu-trusty-64:/etc/apache2/sites-available# ls /var/www/demo/lib/rdf-db.php
ls: cannot access /var/www/demo/lib/rdf-db.php: No such file or directory

Hmm, looks like the lib directory is missing

dbkeator commented 8 years ago

That's weird, it appears git add won't add things in a directory named "lib" unless one uses the -f (force) parameter. Anyway, the repo has been updated to include lib.

nicholsn commented 8 years ago

OK, one step closer =)

I'm now getting the drop down menus, but not returning any results. If I select "Human Brain Segmentations" and choose Left Amygdala from the down I see the following in the access.log:

10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET / HTTP/1.1" 200 1435 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /css/conte-style.css HTTP/1.1" 200 1925 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /css/fileupload.css HTTP/1.1" 200 1143 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/responsive-modernizr.js?ver=2.6.1 HTTP/1.1" 200 7009 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/conte-dojo.js HTTP/1.1" 200 952 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/conte-xtk.js HTTP/1.1" 200 1138 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/conte-js.js HTTP/1.1" 200 2043 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /css/nihilo.css HTTP/1.1" 200 13979 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/resumable.js HTTP/1.1" 200 7473 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /css/style.css?ver=1.9.3.4 HTTP/1.1" 200 11088 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/fileupload.js HTTP/1.1" 200 1132 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /images/NIDM_Demo_Banner.png HTTP/1.1" 304 181 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/responsive-scripts.js?ver=1.2.4 HTTP/1.1" 200 3911 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:27 +0000] "GET /js/dojo/dojo/dojo.js HTTP/1.1" 200 55393 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:28 +0000] "GET /js/conte-jquery.js HTTP/1.1" 200 572 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
10.0.2.2 - - [27/Oct/2015:18:46:30 +0000] "GET /query.php HTTP/1.1" 200 1652 "http://localhost:4567/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"
::1 - - [27/Oct/2015:18:46:35 +0000] "OPTIONS * HTTP/1.0" 200 125 "-" "Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.13 (internal dummy connection)"
::1 - - [27/Oct/2015:18:46:38 +0000] "OPTIONS * HTTP/1.0" 200 125 "-" "Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.13 (internal dummy connection)"
10.0.2.2 - - [27/Oct/2015:18:46:47 +0000] "GET /fetch-anatomical-regions.php?project=4&fetch=anatomical-regions HTTP/1.1" 200 1115 "http://localhost:4567/query.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"

The weird thing is that after I click "Go!", I don't see any additional entry in the access.log or error.log.. Also not seeing anything in virtuoso.log...

Any suggestions for how to debug this? Seems like the query isn't actually being executed on "Go!"

dbkeator commented 8 years ago

Ok, there were a couple issues I created when I tried to "clean things up". It's tricky business. I also noticed that the heart rate data I created for SFN wasn't in the virtuoso backup so I created a new full backup. Give this a shot...you can test it without restoring the full backup noting that the heart rate query won't return any data but the other interfaces should. When that's working then maybe blow away and restore the DB again from the backup.

nicholsn commented 8 years ago

BOOYA! Now it's up an working =)

Thanks for all your help with this!

dbkeator commented 8 years ago

Sure...thanks for being the tester. Now we should talk about how to modify things...