View Issue Details

IDProjectCategoryView StatusLast Update
14778Bug reports[All Projects] Installationpublic2019-04-23 15:59
ReporterRomanFischerAssigned Toc_schmitz 
PrioritynoneSeverityblock 
Status assignedResolutionopen 
Product Version3.17.x 
Target VersionFixed in Version 
Summary14778: Could not add administrator settings: CDbException: The table "{{users}}" for active record class "User" cannot be found in the
Description

I try to install limesurvey3.17.1+190408 in an Docker Container (Container based on Ubuntu 18.04) using an external PostgreSQL-database.

The installation process works fine until sending the administrator settings (http://localhost:9987/limesurvey/index.php?r=installer/optional).

The tables (46) and sequences (32) are created in the database.

installed additional php-packages in the Docker-Container (all from Ubuntu 18.04 repositories):

php7.2-xml
php7.2-zip
php7.2-readline
php7.2-pgsql
php7.2-opcache
php7.2-mysql
php7.2-mbstring
php7.2-json
php7.2-intl
php7.2-imap
php7.2-gd
php7.2-curl
php7.2-common
php7.2-cli
php7.2-ldap
php-xdebug
php-common
php-apcu-bc
php-apcu

Steps To Reproduce

Just following the installation procedure to the administrator settings.

Additional Information

Could not add administrator settings: CDbException: The table "{{users}}" for active record class "User" cannot be found in the database. in /var/www/html/limesurvey/framework/db/ar/CActiveRecord.php:2390 Stack trace: #0 /var/www/html/limesurvey/framework/db/ar/CActiveRecord.php(413): CActiveRecordMetaData->__construct(Object(User)) #1 /var/www/html/limesurvey/framework/db/ar/CActiveRecord.php(682): CActiveRecord->getMetaData() #2 /var/www/html/limesurvey/application/models/LSActiveRecord.php(34): CActiveRecord->hasAttribute('created') #3 /var/www/html/limesurvey/framework/db/ar/CActiveRecord.php(398): LSActiveRecord->behaviors() #4 /var/www/html/limesurvey/application/models/User.php(53): CActiveRecord::model('User') #5 /var/www/html/limesurvey/application/controllers/InstallerController.php(594): User::model() #6 /var/www/html/limesurvey/application/controllers/InstallerController.php(87): InstallerController->stepOptionalConfiguration() #7 /var/www/html/limesurvey/framework/web/CWebApplication.php(282): InstallerController->run('optional') #8 /var/www/html/limesurvey/framework/web/CWebApplication.php(141): CWebApplication->runController('installer/optio...') #9 /var/www/html/limesurvey/framework/base/CApplication.php(185): CWebApplication->processRequest() #10 /var/www/html/limesurvey/index.php(194): CApplication->run() #11 {main}.

TagsNo tags attached.
Complete LimeSurvey version number (& build)limesurvey3.17.1+190408
I will donate to the project if issue is resolvedNo
BrowserFirefox 60.6.1esr (64-bit)
Database & DB-VersionPosgresSQL 10.x
Server OS (if known)Docker-Host: RHEL7, Container: Ubuntu 18.04
Webserver software & version (if known)Apache 2.4
PHP Version7.2

Activities

RomanFischer

RomanFischer

2019-04-17 14:45

reporter   ~51498

Additional informations:

  • my Postgresql Version is 10.6
  • I tried installation without Docker on a plane Ubuntu 18.04 - the same result.
  • My database admin and I analysed the behaviour of the installation process. There is really an error occurring in the database:

    2019-04-17 14:25:47.812 CEST,"limesurveyplayground_admin","limesurveyplayground",20287,"10.153.99.8:42138",5cb71b4b.4f3f,3,"SELECT",2019-04-17 14:25:47 EST,116/74592,0,ERROR,42P01,"relation ""lime_users"" does not exist",,,,,,"SELECT * FROM ""lime_users""",15,,""

    BUT: This error happens BEFORE I press the button "populate database". After pressing the button the table will be created. An later on the next page I get this error.

It seems to me that the "SELECT * FROM lime_users" maybe is executed to test if an old installation exist. But later in the installation process, after table creation, someone has forgotten to execute the select statement again. And so the old result caused the failure - just a guess.

c_schmitz

c_schmitz

2019-04-18 14:44

administrator   ~51520

I am sorry but I cannot reproduce the problem. I can install on Postgres without problems.
The error indicated that the user table was not created. So can you check if the user table really exists at that point where the error shows up?

RomanFischer

RomanFischer

2019-04-18 17:22

reporter   ~51532

As I mentioned above, we find an error message (in the db logs) when accessing the users table BEFORE we push the "populate database button" ! Maybe or maybe not that there is an relation of this db error to the later php error.

To repoduce the problem again I erased the schema with:

drop schema limesurveyplayground cascade;
create schema limesurveyplayground;

Then started the installation process again - and failed again.

I made a pg_dump of the database created by your installation process. As you can see there is a table lime_users created!

Kind Regards,
Roman Fischer



limesurveyplayground.sql (147,006 bytes)
DenisChenu

DenisChenu

2019-04-18 18:04

developer   ~51533

If you do install again and again with same DB but different prefix : remind to clean up tmp/runtime directiry too. (maybe not related, just an idea)

RomanFischer

RomanFischer

2019-04-18 18:29

reporter   ~51534

As you can see on this little screenshot, the tmp/runtime directory is quite empty - what should I remove?

RomanFischer

RomanFischer

2019-04-18 18:29

reporter   ~51535

Try to upload again :-)



emptyRuntime.PNG (28,763 bytes)
emptyRuntime.PNG (28,763 bytes)
RomanFischer

RomanFischer

2019-04-18 18:31

reporter   ~51536

BTW: I don't you different table prefixes, I removed the whole database schema and recreated it.

DenisChenu

DenisChenu

2019-04-19 02:22

developer   ~51537

(maybe not related, just an idea)

RomanFischer

RomanFischer

2019-04-19 09:05

reporter   ~51538

My database administrator created a new PostgresSQL cluster and a new database. We got the same error. I attached the whole DB log (inclusive DB creation) and the apache access log, Attentions: It seems that the clocks of both servers are a little bit out of sync, so that may confuse when comparing the logs. Are there any other logs created while installation process (I did not find any)?



apache_access.log (14,936 bytes)
PGSHARE5-2019-04-19.csv (145,739 bytes)
RomanFischer

RomanFischer

2019-04-23 13:12

reporter   ~51547

I found the reason for this error: Our database administration don't like to use the "public" schema. So when creating a database they create inside a new schema (named the same as database itself) and revoking all access rights to the "public" schema.

For testing purposes I created a new database without a new schema, so that the database has only the "public" schema.

USING THIS DATABASE HAVING ONLY A PUBLIC SCHEMA - THE INSTALLATION PROCESS WORKED CORRECTLY!!!

Conclusion: The Installation procedure don't ask me for a database schema name. Surprisingly it finds my schema and creates the tables in it. But at a later screen it seems that the procecure looks in the public schema again (and don't find the users table):

Suggestions:

  • prevent Installation when public schema is not available
  • work with the automatically selected schema correctly
  • user Input of the wanted schema name, and work correctly with ist :-) - my prevered solution

Regards, Roman Fischer

RomanFischer

RomanFischer

2019-04-23 15:05

reporter   ~51550

Short additional Information: Maybe the tables are created because our database admin sets the search path of the database to our created schema.

c_schmitz

c_schmitz

2019-04-23 15:59

administrator   ~51551

Hey Roman,

thank you for the feedback. Problem is/was that 'schema' does not exist in other database systems so it is never something we even considered to be a problem as the installation procedure needs to be compatible for all database systems (MySQL, Postgres and MSSQL)

Issue History

Date Modified Username Field Change
2019-04-16 15:42 RomanFischer New Issue
2019-04-17 14:45 RomanFischer Note Added: 51498
2019-04-18 14:44 c_schmitz Assigned To => c_schmitz
2019-04-18 14:44 c_schmitz Status new => feedback
2019-04-18 14:44 c_schmitz Note Added: 51520
2019-04-18 17:22 RomanFischer File Added: limesurveyplayground.sql
2019-04-18 17:22 RomanFischer Note Added: 51532
2019-04-18 17:22 RomanFischer Status feedback => assigned
2019-04-18 18:04 DenisChenu Note Added: 51533
2019-04-18 18:29 RomanFischer Note Added: 51534
2019-04-18 18:29 RomanFischer File Added: emptyRuntime.PNG
2019-04-18 18:29 RomanFischer Note Added: 51535
2019-04-18 18:31 RomanFischer Note Added: 51536
2019-04-19 02:22 DenisChenu Note Added: 51537
2019-04-19 09:05 RomanFischer File Added: apache_access.log
2019-04-19 09:05 RomanFischer File Added: PGSHARE5-2019-04-19.csv
2019-04-19 09:05 RomanFischer Note Added: 51538
2019-04-23 13:12 RomanFischer Note Added: 51547
2019-04-23 15:05 RomanFischer Note Added: 51550
2019-04-23 15:59 c_schmitz Note Added: 51551