View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18393Bug reportsSurvey editingpublic2022-10-04 16:06
Reportermhladun Assigned Togabrieljenik  
PriorityhighSeverityblock 
Status closedResolutionno change required 
Product Version5.3.x 
Summary18393: Clicking "switch to closed-access mode" on a new survey creates an error when previewing or running the survey
Description

I originally didn't know the cause of this bug, and filed a misleading issue here: https://bugs.limesurvey.org/view.php?id=18389. The error being raised is the same. From what I can tell, this isn't an issue with any of the surveys using closed-access mode already. Only survey that are being created now.

2022/10/03 17:30:11 [error] [system.db.CDbCommand] CDbCommand::fetch() failed: SQLSTATE[HY000]: General error: 7 message contents do not agree with length in message type "N"
ERROR: invalid input syntax for type integer: "f"
LINE 1: ...ailed_login_attempts" "t" WHERE number_attempts > 'f' AND ip...
^. The SQL statement executed was: SELECT * FROM "lime_failed_login_attempts" "t" WHERE number_attempts > :attempts AND ip = :ip AND is_frontend = :is_frontend LIMIT 1.
2022/10/03 17:30:11 [error] [exception.CDbException] CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 7 message contents do not agree with length in message type "N"
ERROR: invalid input syntax for type integer: "f"
LINE 1: ...ailed_login_attempts" "t" WHERE number_attempts > 'f' AND ip...
^ in /var/www/html/limesurvey/framework/db/CDbCommand.php:543
Stack trace:
#0 /var/www/html/limesurvey/framework/db/CDbCommand.php(415): CDbCommand->queryInternal()
#1 /var/www/html/limesurvey/framework/db/ar/CActiveRecord.php(1359): CDbCommand->queryRow()
#2 /var/www/html/limesurvey/application/models/LSActiveRecord.php(77): CActiveRecord->query()
#3 /var/www/html/limesurvey/framework/db/ar/CActiveRecord.php(1464): LSActiveRecord->query()
#4 /var/www/html/limesurvey/application/models/FailedLoginAttempt.php(121): CActiveRecord->find()
#5 /var/www/html/limesurvey/application/helpers/frontend_helper.php(1113): FailedLoginAttempt->isLockedOut()
#6 /var/www/html/limesurvey/application/helpers/SurveyRuntimeHelper.php(1658): testIfTokenIsValid()
#7 /var/www/html/limesurvey/application/helpers/SurveyRuntimeHelper.php(200): SurveyRuntimeHelper->showTokenOrCaptchaFormsIfNeeded()
#8 /var/www/html/limesurvey/application/controllers/survey/index.php(618): SurveyRuntimeHelper->run()
#9 /var/www/html/limesurvey/application/controllers/survey/index.php(22): Index->action()
#10 /var/www/html/limesurvey/framework/web/actions/CAction.php(76): Index->run()
#11 /var/www/html/limesurvey/framework/web/CController.php(308): CAction->runWithParams()
#12 /var/www/html/limesurvey/framework/web/CController.php(286): CController->runAction()
#13 /var/www/html/limesurvey/framework/web/CController.php(265): CController->runActionWithFilters()
#14 /var/www/html/limesurvey/framework/web/CWebApplication.php(282): CController->run()
#15 /var/www/html/limesurvey/framework/web/CWebApplication.php(141): CWebApplication->runController()
#16 /var/www/html/limesurvey/framework/base/CApplication.php(185): CWebApplication->processRequest()
#17 /var/www/html/limesurvey/index.php(192): CApplication->run()
#18 {main}
REQUEST_URI=/index.php?r=survey/index&sid=214598&newtest=Y&lang=en
HTTP_REFERER=https://survey.<DOMAIN>.ca/index.php?r=surveyAdministration/view&surveyid=214598

Steps To Reproduce

Steps to reproduce

Create a new survey
Go to Survey Participants
When prompted with "Survey participants have not been initialised for this survey..." , click "Switch to closed-access mode"
Go to Preview Survey and you will receive an error.

Expected result

The survey runs with no errors.

Actual result

The error, shown in my uploaded screenshot, is raised.

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build) 5.3.32 build 220817
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionPostgreSQL 12.9 (EnterpriseDB Advanced Server 12.9.13) on x86_64-pc-linux-gnu, compiled by gcc (SUSE Linux) 4.8.5, 64-bit
Server OS (if known)CentOS Linux 8
Webserver software & version (if known)Apache/2.4.37 (centos) OpenSSL/1.1.1k
PHP Version 8.0.22

Relationships

related to 18389 closedgabrieljenik Previewing a survey leads to a SQL error. 

Users monitoring this issue

There are no users monitoring this issue.

Activities

mhladun

mhladun

2022-10-03 20:02

reporter   ~72049

I will test this on 5.4.3 - 220926

mhladun

mhladun

2022-10-03 20:09

reporter   ~72050

On my test instance running version 5.3.30 build 220808, I am not prompted with "Survey participants have not been initialized for this survey..." and do not receive an error when I go to preview a new survey

mhladun

mhladun

2022-10-03 21:10

reporter   ~72051

This is happening after updating to 5.4.3 as well.

Our system configuration:
LimeSurvey version: 5.4.3
LimeSurvey build: 220926
PHP version: 8.0.22
Web server software: Apache/2.4.37 (centos) OpenSSL/1.1.1k
Database driver: pgsql
Database driver version: 13.3
Database server info: PID: 40158; Client Encoding: UTF8; Is Superuser: on; Session Authorization: limesurvey_admin; Date Style: ISO, DMY
Database server version: 12.9.13

It is after I create a participants table that an error is raised why running a new survey.

Survey participants
A participant table has been created for this survey. ("lime_tokens_284683")

The logged error:
2022/10/03 19:04:18 [error] [system.db.CDbCommand] CDbCommand::fetch() failed: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "f"
LINE 1: ...ailed_login_attempts" "t" WHERE number_attempts > 'f' AND ip...
^. The SQL statement executed was: SELECT * FROM "lime_failed_login_attempts" "t" WHERE number_attempts > :attempts AND ip = :ip AND is_frontend = :is_frontend LIMIT 1.

mhladun

mhladun

2022-10-03 21:12

reporter   ~72053

Switching to open-access mode allows me to run the survey.

gabrieljenik

gabrieljenik

2022-10-04 14:28

manager   ~72072

Last edited: 2022-10-04 14:30

Can you please check config-defaults.php, around line 64.
What's the entry for maxLoginAttemptParticipants ?

Also, how's that setting in the DB (or the global settings screen)?

Thanks

mhladun

mhladun

2022-10-04 15:41

reporter   ~72091

This was the cause of the problem. config-defaults.php hadn't been updated, so there was no maxLoginAttemptParticipants config. Simply replacing the previous config-defaults.php solved this issue. Thank you for taking the time to respond.

Issue History

Date Modified Username Field Change
2022-10-03 19:56 mhladun New Issue
2022-10-03 19:56 mhladun File Added: Screenshot 2022-10-03 135029.png
2022-10-03 20:02 mhladun Note Added: 72049
2022-10-03 20:02 mhladun Bug heat 0 => 2
2022-10-03 20:09 mhladun Note Added: 72050
2022-10-03 21:10 mhladun Note Added: 72051
2022-10-03 21:12 mhladun Note Added: 72053
2022-10-04 11:16 ollehar Priority none => high
2022-10-04 14:25 gabrieljenik Relationship added related to 18389
2022-10-04 14:28 gabrieljenik Note Added: 72072
2022-10-04 14:28 gabrieljenik Bug heat 2 => 4
2022-10-04 14:28 gabrieljenik Status new => acknowledged
2022-10-04 14:30 gabrieljenik Note Edited: 72072
2022-10-04 15:41 mhladun Note Added: 72091
2022-10-04 16:06 gabrieljenik Assigned To => gabrieljenik
2022-10-04 16:06 gabrieljenik Status acknowledged => closed
2022-10-04 16:06 gabrieljenik Resolution open => no change required