View Issue Details

This bug affects 1 person(s).
 16
IDProjectCategoryView StatusLast Update
17927Bug reportsComfortUpdatepublic2022-03-08 11:47
ReporterDarioRoig Assigned Toc_schmitz  
PriorityurgentSeverityminor 
Status closedResolutionfixed 
Product Version5.2.x 
Summary17927: update from 5.2.13 to 5.3.2 in Postgresql
Description

Hi, I have had two problems to update.

If you update from 5.2.13 to 5.3.2, it seems that everything is ok, but when you try to login, it shows error 500.
The first problem is about column is_frontend, It solves changing the new column is_frontend from boolean to integer in the next file:

application/helpers/update/updates/Update_481.php

$this->db->createCommand()->addColumn(
'{{failed_login_attempts}}',
'is_frontend',
"integer NOT NULL DEFAULT 0"
);

The other problem is when the update attempt to do this other change,

ALTER TABLE lime_message ALTER COLUMN language DROP NOT NULL

it fails because you need drop first constraint "lime_message_pk" column "language" in the database.

After these changes you can access without any problem.

Thanks a lot for this amazing product.

Regards

Steps To Reproduce

Steps to reproduce

update with comforupdate from 5.2.13 to 5.3.2 in Postgresql

Expected result

Access to the admin page without any problem

Actual result

It shows error 500 when you try t access to admin page.

TagsNo tags attached.
Bug heat16
Complete LimeSurvey version number (& build)5.3.2
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgresql 9.6.20
Server OS (if known)
Webserver software & version (if known)
PHP Version7.3

Relationships

related to 17917 closedgalads A non-recoverable error happened during the update to LS 5.3 

Users monitoring this issue

DarioRoig

Activities

zufolo441

zufolo441

2022-03-04 11:01

reporter   ~68535

Hi, I foud only the first error, and I solved au contraire: "boolean NOT NULL DEFAULT false"

zufolo441

zufolo441

2022-03-04 11:06

reporter   ~68536

Last edited: 2022-03-07 08:01

I found same erroneous definition in installer/create-database.php:
// failed_login_attempts
$oDB->createCommand()->createTable('{{failed_login_attempts}}', array(
'id' => "pk",
'ip' => "string(40) NOT NULL",
'last_attempt' => "string(20) NOT NULL",
'number_attempts' => "integer NOT NULL",
'is_frontend' => "boolean NOT NULL DEFAULT 0"
), $options);

which is correct field type? int or bool ?

DarioRoig

DarioRoig

2022-03-04 11:43

reporter   ~68537

Last edited: 2022-03-07 08:01

Hi, may be is better your solution (boolean NOT NULL DEFAULT false), because at the code which read the field is_frontend hopes a boolean var.

I'm going to test these changes in a test enviroment.
Error log:
LINE 1: ...E number_attempts > 10 AND ip = '147.156.9.8' AND is_fronten...
^. La sentencia SQL ejecutada fue: SELECT * FROM "lime_failed_log in_attempts" "t" WHERE number_attempts > :attempts AND ip = :ip AND is_frontend = :is_frontend LIMIT 1

Regards

ollehar

ollehar

2022-03-07 10:02

administrator   ~68546

@DenisChenu please check this.

ollehar

ollehar

2022-03-07 10:03

administrator   ~68547

Ah wait, this is related to Patricia's fix.

galads

galads

2022-03-07 10:27

reporter   ~68549

Last edited: 2022-03-07 10:28

Yeah, this is related to Patricia's fix, we did not test with Postgress

ollehar

ollehar

2022-03-07 10:29

administrator   ~68550

The second problem is update 482 by Denis, I think.

DenisChenu

DenisChenu

2022-03-07 10:32

developer   ~68551

Arg : need to reset PK during update …

c_schmitz

c_schmitz

2022-03-07 10:51

administrator   ~68552

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=33326

ollehar

ollehar

2022-03-07 10:54

administrator   ~68553

Resolved or only first part resolved?

ollehar

ollehar

2022-03-07 10:59

administrator   ~68554

Last edited: 2022-03-07 11:01

Also should be tested. And reviewed?

DenisChenu

DenisChenu

2022-03-07 11:02

developer   ~68556

Seems PK reset broken ?

ollehar

ollehar

2022-03-07 11:13

administrator   ~68557

Dunno. @DarioRoig Can you test with the latest master branch too, perhaps?

LimeBot

LimeBot

2022-03-08 11:47

administrator   ~68580

Fixed in Release 5.3.4+220309

Related Changesets

LimeSurvey: master bd5fd4f6

2022-03-07 10:30:17

c_schmitz

Details Diff
Fixed issue 17927: Error on database update when using Postgres Affected Issues
17927
mod - application/helpers/update/updates/Update_481.php Diff File
mod - installer/create-database.php Diff File

Issue History

Date Modified Username Field Change
2022-03-04 08:10 DarioRoig New Issue
2022-03-04 11:01 zufolo441 Note Added: 68535
2022-03-04 11:01 zufolo441 Bug heat 0 => 2
2022-03-04 11:06 zufolo441 Note Added: 68536
2022-03-04 11:33 DarioRoig Issue Monitored: DarioRoig
2022-03-04 11:33 DarioRoig Bug heat 2 => 4
2022-03-04 11:43 DarioRoig Note Added: 68537
2022-03-04 11:43 DarioRoig Bug heat 4 => 6
2022-03-07 08:01 galads Assigned To => galads
2022-03-07 08:01 galads Status new => confirmed
2022-03-07 08:01 galads Priority none => urgent
2022-03-07 08:01 galads Zoho Project Synchronization => |Yes|
2022-03-07 10:02 ollehar Note Added: 68546
2022-03-07 10:02 ollehar Bug heat 6 => 8
2022-03-07 10:03 ollehar Note Added: 68547
2022-03-07 10:27 galads Note Added: 68549
2022-03-07 10:27 galads Bug heat 8 => 10
2022-03-07 10:28 galads Note Edited: 68549
2022-03-07 10:29 ollehar Note Added: 68550
2022-03-07 10:32 DenisChenu Note Added: 68551
2022-03-07 10:32 DenisChenu Bug heat 10 => 12
2022-03-07 10:46 c_schmitz Relationship added related to 17917
2022-03-07 10:46 c_schmitz Status confirmed => resolved
2022-03-07 10:46 c_schmitz Resolution open => fixed
2022-03-07 10:51 c_schmitz Changeset attached => LimeSurvey master bd5fd4f6
2022-03-07 10:51 c_schmitz Note Added: 68552
2022-03-07 10:51 c_schmitz Bug heat 12 => 14
2022-03-07 10:51 c_schmitz Assigned To galads => c_schmitz
2022-03-07 10:54 ollehar Note Added: 68553
2022-03-07 10:59 ollehar Note Added: 68554
2022-03-07 11:01 ollehar Note Edited: 68554
2022-03-07 11:02 DenisChenu Note Added: 68556
2022-03-07 11:13 ollehar Note Added: 68557
2022-03-08 11:47 LimeBot Zoho Project Synchronization Yes => |Yes|
2022-03-08 11:47 LimeBot Note Added: 68580
2022-03-08 11:47 LimeBot Status resolved => closed
2022-03-08 11:47 LimeBot Bug heat 14 => 16