Page 1 of 2

Error updating several entities

Posted: 12 Nov 2018, 15:24
by StuartB_75
Good morning, I'm not sure if this is a bug or unique to my application.
I've created a new drop-down field 'Origin' in an Entity 'Exhibits'. I can update existing records one-by-one, but when I try to select several records and update the drop down I get the following error window and I'm then logged out.

"Database Error: 1062 - Duplicate entry '1616e77bbd2c6087837632919b170409' for key 'PRIMARY'

Query: insert into app_sessions values ('1616e77bbd2c6087837632919b170409409', '1542022159', 'uploadify_attachments|a:0:{}uploadify_attachments_queue|a:0:{}alerts|N;app_send_to|N;app_session_token|s:10:\"NKNOo%PT@o\";app_current_users_filter|a:0:{}app_previously_logged_user|i:0;app_logged_users_id|s:1:\"1\";')

Page: /FSB-CCTV/index.php?module=ext/with_selected/update&action=get_field_values&reports_id=170&path=21-15/30&fields_id=&sid=1616e77bbd2c6087837632919b170409409
"

I'm using version 2.3.1 with the appropriate extension pack.

Any advice would be gratefully received.
Many thanks

Re: Error updating several entities

Posted: 12 Nov 2018, 15:39
by support
1) Open config/server.php
2) Find option STORE_SESSIONS
3) change it to
define('STORE_SESSIONS', '');

let me know if it helps

Re: Error updating several entities

Posted: 12 Nov 2018, 16:05
by StuartB_75
I've made the alteration and I now get the following at the logon screen:
"Database Error: 1062 - Duplicate entry '0f7f8fa56942663896dbe1e37b5ced22' for key 'PRIMARY'

Query: insert into app_sessions values ('0f7f8fa56942663896dbe1e37b5ced22378', '1542024728', 'uploadify_attachments|a:0:{}uploadify_attachments_queue|a:0:{}alerts|N;app_send_to|N;app_session_token|s:10:\"U+vTjHBKv^\";app_current_users_filter|a:0:{}app_previously_logged_user|i:0;app_current_version|s:0:\"\";app_selected_items|a:0:{}listing_page_keeper|a:0:{}')

Page: /FSB-CCTV/index.php?module=users/login&sid=0f7f8fa56942663896dbe1e37b5ced22378"


I tried the 'STORE_SESSIONS', with and without the " before the final bracket in your solution. Neither option changed the error from appearing. However, now I'm unable to login

Re: Error updating several entities

Posted: 12 Nov 2018, 16:09
by support
You can open table app_sessions in phpmyadmin and just truncate it (remove all date in this table).
Expired sessions should be deleted automatically but looks like they are not deleted.

Re: Error updating several entities

Posted: 12 Nov 2018, 16:16
by StuartB_75
I changed define('STORE_SESSIONS', ''); to define('STORE_SESSIONS', ''"); which allows for a login, but the system now runs very slowly.
Will "open table app_sessions in phpmyadmin and just truncate it " affect any user details or data in the system?

Re: Error updating several entities

Posted: 12 Nov 2018, 16:26
by support
no, they just need to relogin.

Re: Error updating several entities

Posted: 12 Nov 2018, 16:34
by StuartB_75
OK. Some observations: if "MySQL" is removed then the system takes approx. 2 minutes to open a record. This is much improved by leaving "MySQL" in there.

"Expired sessions should be deleted automatically but looks like they are not deleted." Is there a way to ensure this happens?

Re: Error updating several entities

Posted: 12 Nov 2018, 17:02
by support
StuartB_75 wrote: 12 Nov 2018, 16:34 OK. Some observations: if "MySQL" is removed then the system takes approx. 2 minutes to open a record. This is much improved by leaving "MySQL" in there.
Something not right with your server. We can store session in mysql or files and page load speed should be the same.
Is there a way to ensure this happens?
Since you have this issue then it's not happens.

Re: Error updating several entities

Posted: 12 Nov 2018, 17:22
by StuartB_75
Hi, I have done as asked and deleted all data from 'app_sessions'.
I've edited define('STORE_SESSIONS', 'mysql'); to define('STORE_SESSIONS', '');
I can now login, but it is taking over 2 minutes to open up the Dashboard. It takes as long to open any of the Menu Items and just as long to logout.
Re-instating the 'mysql' to STORE_SESSIONS creates the error message again:

"Database Error: 1062 - Duplicate entry '0f7f8fa56942663896dbe1e37b5ced22' for key 'PRIMARY'

Query: insert into app_sessions values ('0f7f8fa56942663896dbe1e37b5ced22378', '1542028959', 'uploadify_attachments|a:0:{}uploadify_attachments_queue|a:0:{}alerts|N;app_send_to|N;app_session_token|s:10:\"+gH!NytSdS\";app_current_users_filter|a:0:{}app_previously_logged_user|i:0;app_current_version|s:0:\"\";app_selected_items|a:0:{}listing_page_keeper|a:0:{}')

Page: /FSB-CCTV/index.php?module=users/login&sid=0f7f8fa56942663896dbe1e37b5ced22378"


However, MySQL was previously working and loading the Dashboard very quickly, until this morning when the error started.

It's very mysterious. I have a development server on the same system and that is working OK. I have enabled Maintenance Mode. Would this affect things, perhaps?

Many thanks again

Re: Error updating several entities

Posted: 12 Nov 2018, 17:55
by support
No, it looks like there was some updates on server and now there is some conflict somewhere in php configuration.