Case mismatch on table names
Reportula is a php based web program that provides you a summarized ou
Status: Beta
Brought to you by:
oliveiraped
Originally created by: kollegeJack
Hey There,
I am using Bacula Version 5.2.6 and latest Reportula. Cron and userfrontend displaying following error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bacula.client' doesn't exist (SQL: select * from `client`)
My tables all starts with an uppercase letter (e.g. my client table is Client). I don't want to change the table names because I don't know what kind of problems that causes on bacula itself. Is there any idea or fix for that available?
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
Hi this is not the best solution but it works in app/models/CLient.php model file change " protected
$table = 'client'; " to "protected $table = 'Client';".
or the other thing you do is change on MySql database settings this:
Try adding/editing "lower_case_table_names = 2" in my.ini or my.cnf .
You can google'it to see more information about the issue.
Before do that backup you database.
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: kollegeJack
Is that my fault that my table names always starting uppercase or is this a bacula default?
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
I had that problem when i migrated from MySQL database to PostgreSQL, database on Reportula 1 development. On Reportula 2 i used Laravel framework that has ORM component, that abstracts you from the database. I don't think it's your fault. May be it's Bacula database creation script it different from MySQL to PostgreSQL, but i am not sure.
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: kollegeJack
Okay thanks! I fixed the table names in the different models. But now I get the following error:

View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: k0ssi
same error here, i tried to edit Tablenames manualy in .php files but im unable to find each string.
Setting "lower_case_table_names = 2" want work in my case.
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: ricardo777
Same issue for me with clean bacula installation on Ubuntu 14.04 setting "lower_case_table_names = 2" does not work for me.
Then I get the error in mysql SQL show index from
BaseFilesfailed : Table 'bacula.basefiles' doesn't existView and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
Open terminal and edit /etc/mysql/my.cnf
sudo nano /etc/mysql/my.cnf
Underneath the [mysqld] section.add:
lower_case_table_names = 1
Restart mysql
sudo /etc/init.d/mysql restart
Then check it here:
mysqladmin -u root -p variables
Try with 1, if does not work you have to change o table names on the models app files !
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Ticket changed by: oliveiraped
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: westphala
1 also do not work for me.
do you plan to create a patch of the code for that?
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: asyd
Hi,
imho the application should be aware of table case name, since Bacula create 'Client', (and not 'client'), reportula should use 'Client' by default.
Changing a global server parameter for an application sounds a bit stange.
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
Yes its true, but in my case i have my infrastruture in Portgresql Database, and i am developing based on postgres database, on mysql i did that workaround.
Anyone can contribute to solve that problem.
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: asyd
Ok.
Well, sounds like changing model is not enough, after change every bacula related table names in models, i still have an exception:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bacula.file' doesn't exist (SQL: select count(*) AS filesNumber from `file`)Why the name defined in protected table is not used?
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
http://stackoverflow.com/questions/20881700/laravel-4-case-sensitive-database-columns
can check this maybe that will helps
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: westphala
Same here
i changed protected $table = 'client'; to protected $table = 'Client'; and get still this error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bacula.client' doesn't exist (SQL: select * from
Client)do i must change this entry also in other files as under app/models?
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
My Mysql Database
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 674
Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)
My Postgres Database
PostgreSQL 8.4.21 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit
(1 row)
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: asyd
I think you have lower_case_table_names = 1 when you create the bacula database, right?
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
Problably i had but i am not certain ...
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: asyd
hmm, which version of bacula are you using?
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: oliveiraped
The latest comunity version 7.0.4, but i am using bacula since Version 3 só i am being upgrading the database since then.
View and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: asyd
Is mysql support was tested? I create tables with lower_case_table_names = 1, then start to use bacula, but after only two jobs, when hitting the dashboard I have:
ErrorException
Undefined index: jobfiles
in
reportula/vendor/laravel/framework/src/Illuminate/Support/helpers.phpView and moderate all "issues Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: Raphiusks
Hi there.
I'm having the exact same issue as asyd reported. Do you happen to have any suggestions?
Was really looking forward to trying reportula. Obrigado!