View Issue Details

IDProjectCategoryView StatusLast Update
0000240Bacula-Webdocumentationpublic2018-03-11 11:49
ReportermlmmilkywayAssigned Todavide 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version8.0.0-rc2 
Target Version8.0.0-rc3Fixed in Version8.0.0-rc3 
Summary0000240: Unable to install via Composer
DescriptionPHP Fatal error: Class 'CView' not found in /var/www/html/bacula-web/application/views/test.view.php on line 20
PHP Fatal error: Class 'CView' not found in /var/www/html/bacula-web/application/views/backupjob.view.php on line 18,
Steps To Reproduce/usr/local/bin/composer.phar install --no-dev --prefer-source
php /usr/local/bin/composer.phar require bacula-web/bacula-web





Additional InformationUbuntu 16.04.4 LTS

Composer version 1.6.3 2018-01-31 16:28:17

http://maux.sr.unh.edu/bacula-web/application/views/test.view.php
TagsNo tags attached.

Activities

davide

2018-03-06 08:43

manager   ~0000740

It's a documentation issue and I apologize for that.

You can simply install Bacula-Web using Composer using steps below.

1. Make sure you've installed Composer
2. Run this command in your $HOME
    $ composer create-project --prefer-dist bacula-web/bacula-web:*@RC bacula-web
3. Fix ownership
    $ sudo chown -Rv www-data: bacula-web
4. Move bacula-web folder in Apache root folder
    $ sudo mv -v bacula-web /var/www/somepath

Then configure Bacula-Web as mentioned here
http://docs.bacula-web.org/en/latest/02_install/configure.html#install-configure

Can you confirm it works on your side please ?

websun

2018-03-06 09:26

reporter   ~0000743

Made things worse, runs but after that I get:

Database error: Exception message could not find driver

File /var/www/backup/new/core/app/userauth.class.php
Line 38
Exception code 0
Exception message Application backend database file is not writable, please fix it

Permissions are properly set and config is used from 7.4 where it works

davide

2018-03-06 09:36

manager   ~0000744

Last edited: 2018-03-06 09:36

View 2 revisions

Check the error message
Exception message Application backend database file is not writable, please fix it

Make sure <web folder>/application/assets/protected/application.db is writable by Apache user

You need PHP-SQLite module installed too.

websun

2018-03-06 09:41

reporter   ~0000745

Ah yes indeed, missing sqlite. Works and thank you

mlmmilkyway

2018-03-06 14:47

reporter   ~0000746

hi,

followed new instructions,

I found a view-test.php in the applications/views/folder
Tue Mar 06 08:40:23.713586 2018] [:error] [pid 19630] [client 132.177.241.88:3241] script '/var/www/html/bacula-web/test.php' not found or unable to stat

[Tue Mar 06 08:40:29.135319 2018] [:error] [pid 19634] [client 132.177.241.88:3240] PHP Fatal error: Uncaught Error: Call to a member function render() on null in /var/www/html/bacula-web/core/app/webapplication.class.php:112\nStack trace:\n#0 /var/www/html/bacula-web/index.php(21): WebApplication->run()\n#1 {main}\n thrown in /var/www/html/bacula-web/core/app/webapplication.class.php on line 112

from web page:

Database error
File /var/www/html/bacula-web/core/db/cdb.class.php
Line 43
Exception code 14
Exception message SQLSTATE[HY000] [14] unable to open database file
Have you tried to run the test page ?
Check the online documentation on Bacula-Web project site
Rebort a bug or suggest a new feature in the Bacula-Web's bugtracking tool


I am using postgresql and I can login from the command line to the bacula database using the credentials in the config.php file

davide

2018-03-06 16:21

manager   ~0000747

Hi @mlmmilkyway,

> I found a view-test.php in the applications/views/folder
> Tue Mar 06 08:40:23.713586 2018] [:error] [pid 19630] [client 132.177.241.88:3241] script '/var/www/html/bacula-web/test.php' not found or unable to stat

How did you generate this error ? Which link did you use ?

The database error is for the SQLite database application/assets/protected/application.db
Make sure Apache as right permissions on it, and double check you've installed PHP SQLite on your server.

mlmmilkyway

2018-03-06 17:34

reporter   ~0000748

The link was from the main page
http://maux.sr.unh.edu/bacula-web/index.php

I am not using SQLite and the application.db file was not created during the install

davide

2018-03-06 17:39

manager   ~0000749

From the link you've provided, I see this error message

"Application backend database file is not writable, please fix it"

This means that the file application/assets/protected/application.db needs to be owned by Apache user.
To fix this
$ sudo chown -Rv www-data: application/

P.S: PHP SQlite is required as of 8.0.0-rc2 as it's used to store users credentials

Hope it helps

mlmmilkyway

2018-03-06 18:00

reporter   ~0000750

the file application.db was not created during the install
I made it manually and made it group writable but
SQLSTATE[HY000]: General error: 14 unable to open database file

ran the schema lines via sqlite3
chmod g+w /bacula-web/application/views/cache

ownership is not enough by www-data, has to be group writable

mlmmilkyway

2018-03-06 18:05

reporter   ~0000751

had to add myself via command sqlite3 to Users table in the application.db but I can login now and see the running job

davide

2018-03-06 18:07

manager   ~0000752

This is strange,

I did this test on Ubuntu 16.04

$ cd application/assets
$ rm -v protected/application.db
$ ls -ld protected
 drwxr-xr-x 2 www-data www-data 4096 Mar 6 18:02 protected/
Connected to the main page on my server then checked if the db file were created
# ls -l protected/
-rw-r--r-- 1 www-data www-data 3072 Mar 6 18:02 application.db

I'll update the documentation with your feedback anyway.

Thanks for your feedback

davide

2018-03-06 18:39

manager   ~0000753

Do you mind doing one last test please ?

Copy the application.db somewhere else

Change the application/assets/protected folder permission and ownership as below
$ sudo chown -v www-data: application/assets/protected
$ sudo chmod -v g+w application/assets/protected

Then run the app again and make sure the users database is created as expected.

Thanks for your time and your feedback

P.S: don't forget to reset the admin password to something different ;)

davide

2018-03-11 11:49

manager   ~0000756

Documentation is fixed for next release candidate

Issue History

Date Modified Username Field Change
2018-03-05 17:18 mlmmilkyway New Issue
2018-03-06 08:36 davide Assigned To => davide
2018-03-06 08:36 davide Status new => assigned
2018-03-06 08:37 davide Category bug => documentation
2018-03-06 08:37 davide Target Version => 8.0.0-rc3
2018-03-06 08:43 davide Status assigned => feedback
2018-03-06 08:43 davide Note Added: 0000740
2018-03-06 08:47 davide Summary php fatal error => Unable to install via Composer
2018-03-06 09:26 websun Note Added: 0000743
2018-03-06 09:36 davide Note Added: 0000744
2018-03-06 09:36 davide Note Edited: 0000744 View Revisions
2018-03-06 09:41 websun Note Added: 0000745
2018-03-06 14:47 mlmmilkyway Note Added: 0000746
2018-03-06 14:47 mlmmilkyway Status feedback => assigned
2018-03-06 16:21 davide Status assigned => feedback
2018-03-06 16:21 davide Note Added: 0000747
2018-03-06 17:34 mlmmilkyway Note Added: 0000748
2018-03-06 17:34 mlmmilkyway Status feedback => assigned
2018-03-06 17:39 davide Note Added: 0000749
2018-03-06 18:00 mlmmilkyway Note Added: 0000750
2018-03-06 18:05 mlmmilkyway Note Added: 0000751
2018-03-06 18:07 davide Note Added: 0000752
2018-03-06 18:39 davide Status assigned => feedback
2018-03-06 18:39 davide Note Added: 0000753
2018-03-11 11:49 davide Status feedback => resolved
2018-03-11 11:49 davide Resolution open => fixed
2018-03-11 11:49 davide Fixed in Version => 8.0.0-rc3
2018-03-11 11:49 davide Note Added: 0000756