View Issue Details

IDProjectCategoryView StatusLast Update
14874Bug reports[All Projects] Installationpublic2019-06-03 08:23
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status resolvedResolutionreopened 
Product Version4.0.0dev 
Target VersionFixed in Version4.0.0-beta 
Summary14874: This DB send a 504 when upgrade …
Description

When trying to upgrade i receive 504 error … (and don't find error in log … i try too with hacking index to get all errors)
Sorry … for this lack of informations …

Steps To Reproduce

Import this DB, try to setup/update with this DB

Additional Information

Potential issue

  1. skelvanilla set as default temple
  2. Lot of plugin not in plugin directory
  3. Lot of DB table ?

After reloading : seems better (see the screenshots)

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.0.0 github e7f3dd9
I will donate to the project if issue is resolvedNo
BrowserFF 66
Database & DB-Version10.3.12-MariaDB (mysqlnd 5.0.12-dev)
Server OS (if known)fedora/linux
Webserver software & version (if known)nginx/1.14.2
PHP Version7.2.17

Relationships

related to 14926 closeddominikvitt Feature requests Don't set encrypted firstname + lastname column by default 

Activities

DenisChenu

DenisChenu

2019-05-09 15:36

developer  

ls_master.sql.zip (1,589,139 bytes)
DenisChenu

DenisChenu

2019-05-09 15:36

developer   ~51856

Before Capture d’écran du 2019-05-09 15-31-56.png i have ngynx 504 issue

dominikvitt

dominikvitt

2019-05-09 16:51

developer   ~51857

I'm having PHP warning: Creating default object from empty value

I'll try to fix it.



PHP warning.html (5,028 bytes)
DenisChenu

DenisChenu

2019-05-09 17:50

developer   ~51858

Not related to this issue but:

  1. How you have this issue ?
  2. How you do the html ? What browser (seems a partial HTML


Capture d’écran du 2019-05-09 17-50-36.png (296,592 bytes)
dominikvitt

dominikvitt

2019-05-10 13:48

developer   ~51860

Upgrade errors are fixed:
https://github.com/LimeSurvey/LimeSurvey/commit/35b080c32d871938c187410923432f7dccda3859

@DenisChenu: Try again!

DenisChenu

DenisChenu

2019-05-11 12:03

developer   ~51902

Last edited: 2019-05-11 12:41

View 2 revisions

Still have issue

No slow query

Have some warning

2019-05-11 12:01:00 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2019-05-11 12:01:00 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2019-05-11 12:01:00 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2019-05-11 12:01:00 0 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2019-05-11 12:01:00 0 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade

I try more log

DenisChenu

DenisChenu

2019-05-11 12:39

developer   ~51903

Last edited: 2019-05-11 12:41

View 2 revisions

Due to time limit in conexion between ngynx and PHP : after 504 error : DB still updated …
I think we must cut in different part all DB update : all i10n update take a very long time

504 during INSERT answer_i10n …

DenisChenu

DenisChenu

2019-05-11 18:25

developer   ~51905

Last edited: 2019-05-11 18:25

View 2 revisions

@dominikvitt : i think only step by step upgrade can be done
1 solutions

  • Update to next link
  • Update step by step in ajax

The 2 need updateing https://github.com/LimeSurvey/LimeSurvey/blob/35b080c32d871938c187410923432f7dccda3859/application/helpers/update/updatedb_helper.php#L29

db_upgrade_all($iOldDBVersion, $bSilent = false, $steps= null)
or
db_upgrade_all($iOldDBVersion, $bSilent = false, $toVersion= null)

You can give me (still i can't work on Survey curently)
The 1st is more easy (just a counter)

DenisChenu

DenisChenu

2019-05-12 17:27

developer   ~51907

Last edited: 2019-05-12 17:36

View 3 revisions

Only 400 upgrade broke, due to a lot of foreach …

Maybe find another way than doinf a foreach ?

INSERT INTO answertemp (qid, code, scale_id)
SELECT answer.qid, answer.code, answer.scale_id
FROM answer (JOIN answer answerdouble WHERE  …)

Or …
a dirty

                echo ".";
                ob_flush();
                flush();
                ob_flush();
                flush();

And updat it via ajax ?

ollehar

ollehar

2019-05-13 10:56

administrator   ~51909

Problem: Reaching max execution time will not do a transaction rollback.

Solutions:

1) Set max execution time to 0 (infinite) before db ugprade, restore after done.
2) Check how long the script has run, throw exception if too close to max execution time.

ollehar

ollehar

2019-05-13 10:57

administrator   ~51910

A separate issue is the lack of feedback during upgrade. A solution would be flushing the buffer, as you say, Denis.

ollehar

ollehar

2019-05-13 11:02

administrator   ~51911

Some different hacks are available in the comment section here: https://php.net/manual/en/function.set-time-limit.php

DenisChenu

DenisChenu

2019-05-13 11:13

developer   ~51912

Last edited: 2019-05-13 11:14

View 2 revisions

I already use set_time_limit in a foreach instruction on one of my plugin : it's better than set to 0.

Here : i don't think it'a set_time_limit , since it's set as 1200 … via config.php : https://github.com/LimeSurvey/LimeSurvey/blob/9419b901de451fdef5c017a31611c434ba88711f/application/core/LSYii_Controller.php#L104

PS: PHP script still working after 504 : it's NOT a php issue …

Else : this commit : https://github.com/LimeSurvey/LimeSurvey/pull/1278 really improve 400 upgrade : it's OK on my server with thgis DB.

We still need a ajax/step system but don't use a foreach question/group/answers make it very quickest.

ollehar

ollehar

2019-05-13 11:29

administrator   ~51913

Hm.

DenisChenu

DenisChenu

2019-05-13 14:20

developer   ~51924

For speed comparaison

~24s
simplescreenrecorder-2019-05-13_14.09.10

VS more than 4 minutes
https://framadrop.org/r/96zPJgI2K_#xyBwlCppuBIDUL34DegO+ypolcuqaK4/7bPLWL4EcqA=

With my local computer



simplescreenrecorder-2019-05-13_14.09.10.webm (348,491 bytes)
DenisChenu

DenisChenu

2019-05-15 01:10

developer   ~51938

Broken lime_answers ( updating manually scale_id and sort_order on qid : 4599). since scale_id and sort_order are not in pk : can happen.

DenisChenu

DenisChenu

2019-05-15 01:10

developer  

lime_answers.sql (180,367 bytes)
DenisChenu

DenisChenu

2019-05-22 20:01

developer   ~52057

All done https://github.com/LimeSurvey/LimeSurvey/pull/1282

The DB action (method) are done on https://github.com/Shnoulle/Test-LS-checkDbForUpgrade

Checked on PGSQL 9.1.24 (little DB but with multi language)

  • [x] Questions update
  • [x] Groups update
  • [x] Answers update
  • [x] Labels update
  • [x] DefaultValues update

Checked on PGSQL 10 (little DB but with multi language)

  • [x] Questions update
  • [x] Groups update
  • [x] Answers update
  • [x] Labels update
  • [x] DefaultValues update

Checked on OBDC 11 - MS SQLServer 12

  • [x] Questions update
  • [x] Groups update
  • [x] Answers update
  • [x] Labels update
  • [x] DefaultValues update

On MariaDB 10.3.12

  • [x] Questions update
  • [x] Groups update
  • [x] Answers update
  • [x] Labels update
  • [x] DefaultValues update

Checked on Mysql 5.6.39-1

  • [x] Questions update
  • [x] Groups update
  • [x] Answers update
  • [x] Labels update
  • [x] DefaultValues update
DenisChenu

DenisChenu

2019-06-03 08:23

developer   ~52268

https://github.com/LimeSurvey/LimeSurvey/commit/932542f82bf0fc32f99dfea139d485a742b25162

Issue History

Date Modified Username Field Change
2019-05-09 15:36 DenisChenu New Issue
2019-05-09 15:36 DenisChenu File Added: Capture d’écran du 2019-05-09 15-29-14.png
2019-05-09 15:36 DenisChenu File Added: Capture d’écran du 2019-05-09 15-31-56.png
2019-05-09 15:36 DenisChenu File Added: Capture d’écran du 2019-05-09 15-32-11.png
2019-05-09 15:36 DenisChenu File Added: ls_master.sql.zip
2019-05-09 15:36 DenisChenu Note Added: 51856
2019-05-09 16:51 dominikvitt File Added: PHP warning.html
2019-05-09 16:51 dominikvitt Note Added: 51857
2019-05-09 17:50 DenisChenu File Added: Capture d’écran du 2019-05-09 17-50-36.png
2019-05-09 17:50 DenisChenu Note Added: 51858
2019-05-10 13:48 dominikvitt Note Added: 51860
2019-05-10 15:41 c_schmitz Assigned To => dominikvitt
2019-05-10 15:41 c_schmitz Status new => resolved
2019-05-10 15:41 c_schmitz Resolution open => fixed
2019-05-11 12:03 DenisChenu Status resolved => feedback
2019-05-11 12:03 DenisChenu Resolution fixed => reopened
2019-05-11 12:03 DenisChenu Note Added: 51902
2019-05-11 12:39 DenisChenu Note Added: 51903
2019-05-11 12:39 DenisChenu Status feedback => assigned
2019-05-11 12:41 DenisChenu Note Edited: 51902 View Revisions
2019-05-11 12:41 DenisChenu Note Edited: 51903 View Revisions
2019-05-11 18:25 DenisChenu Note Added: 51905
2019-05-11 18:25 DenisChenu Note Edited: 51905 View Revisions
2019-05-12 17:27 DenisChenu Note Added: 51907
2019-05-12 17:35 DenisChenu Note Edited: 51907 View Revisions
2019-05-12 17:36 DenisChenu Note Edited: 51907 View Revisions
2019-05-13 10:56 ollehar Note Added: 51909
2019-05-13 10:57 ollehar Note Added: 51910
2019-05-13 11:02 ollehar Note Added: 51911
2019-05-13 11:13 DenisChenu Note Added: 51912
2019-05-13 11:14 DenisChenu Note Edited: 51912 View Revisions
2019-05-13 11:29 ollehar Note Added: 51913
2019-05-13 14:20 DenisChenu File Added: simplescreenrecorder-2019-05-13_14.09.10.webm
2019-05-13 14:20 DenisChenu Note Added: 51924
2019-05-15 00:45 DenisChenu Assigned To dominikvitt => DenisChenu
2019-05-15 01:10 DenisChenu Note Added: 51938
2019-05-15 01:10 DenisChenu File Added: lime_answers.sql
2019-05-22 19:59 DenisChenu Relationship added related to 14926
2019-05-22 20:01 DenisChenu Note Added: 52057
2019-06-03 08:23 DenisChenu Status assigned => resolved
2019-06-03 08:23 DenisChenu Fixed in Version => 4.0.0-beta
2019-06-03 08:23 DenisChenu Note Added: 52268