meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

Upgrade to 1.9.2 session has expired #2919

Open jberanek opened 3 years ago

jberanek commented 3 years ago

We got an error upgrading from 1.6.0 to 1.9.0 version. After making a backup, unzip the new version and restore the config.inc.php the databse upgrade script did not execute bueacuse of "session has expored" error. Used the database user credentials configured in the config file (we have checked the credentials).

Tried changing the $auth["session"]="cookie"; $auth["session"]="php"; but did not work.

This are the environtment details:

Red Hat Enterprise Linux Server release 6.8 (Santiago) PHP 5.5.38 (cli) (built: Jul 21 2016 12:51:12) postgres (PostgreSQL) 9.6.2 Server version: Apache/2.2.15 (Unix)

config.inc.php content

<?php
namespace MRBS;
$timezone = 'Europe/Madrid';
$dbsys = 'pgsql';
$db_host = 'localhost';
$db_port = 5432;
$db_database = 'mrbs';
$db_login = 'mrbs_owner';
$db_password = '**********';
$db_tbl_prefix = 'mrbs_';
$db_persist = FALSE;
$mrbs_company = '<img src=images/logo_ayto.jpg align=center>';
$weekstarts = 1;
$hidden_days = array(0,6);
$auth["session"]="cookie";
$cookie_path_override = '/';
$auth["type"] = "db";
$mrbs_admin ='El Administrador';
$mrbs_admin_mail ='sgformacion@madrid.es';
$mail_settings['area_admin_on_bookings'] = TRUE ;
$mail_settings['room_admin_on_bookings'] = TRUE ;
$mail_settings['booker'] = TRUE ;
$mail_settings['on_new'] = TRUE ;
$mail_settings['details'] = TRUE ;
$mail_settings['admin_lang'] = 'es';
$mrbs_admin_mail ='sgformacion@madrid.es';
$mail_settings['organizer'] = 'sgformacion@madrid.es' ;
$mail_settings['recipients'] = 'sgformacion@madrid.es' ;
$mail_settings['ics_filename'] = 'Reserva' ;
$vocab_override["es"]["type.I"] = "Reservas";
$vocab_override["es"]["type.E"] = "Pre-Reservas";
$booking_types[] = "A";  // 'A' is your new type
$vocab_override["es"]["type.A"] = "Convocado";
$booking_types[] = "B";  // 'A' is your new type
$vocab_override["es"]["type.B"] = "Festivos";
$report_filename = "Informe";
$summary_filename = "Resumen";
$csv_col_sep = ',';
$csv_charset = "UTF-16LE";
$csv_bom = TRUE;

Reported by: *anonymous

Original Ticket: mrbs/support-requests/2228

jberanek commented 3 years ago

It's not clear whether you are upgrading to 1.9.0 or 1.9.2? If you trying to upgrade to 1.9.0 then you should upgrade to 1.9.2.

Original comment by: campbell-m

jberanek commented 3 years ago

Diff:


--- old
+++ new
@@ -13,7 +13,9 @@
 Server version: Apache/2.2.15 (Unix)

  config.inc.php content
- &lt;?php
+
+~~~php
+&lt;?php
 namespace MRBS;
 $timezone = &#39;Europe/Madrid&#39;;
 $dbsys = &#39;pgsql&#39;;
@@ -53,3 +55,4 @@
 $csv_col_sep = &#39;,&#39;;
 $csv_charset = &#34;UTF-16LE&#34;;
 $csv_bom = TRUE;
+~~~

Original comment by: jberanek

jberanek commented 3 years ago

Thanks for your advice. Tried to upgrade to 19.2 and had the same error.

Original comment by: *anonymous

jberanek commented 3 years ago

I'm afraid I can't reproduce this. What error message are you getting in your PHP error log? If you can't find the log then set $debug = true; in your config file. Remember to remove all confidential information before posting - especially your database username and password which will probably be in the error message.

Original comment by: campbell-m

jberanek commented 3 years ago

Thanks for the advice. This is the trace and it seems to be a problem with the session.save_path (not customized neither this nor the previoous version):

E_WARNING in Unknown at line 0 Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) MRBS GET: Array ()MRBS POST: Array ( [csrf_token] => 091d54b3fe0e872fc3ab79849fc3d428b56d7d2efea8d305ebeb9db857cc257d [form_username] => xxxxxxxx [form_password] => xxxxxxxx )MRBS SESSION: Array ( [csrf_token] => 447cfc6a0b952608b0276bbf82ce35aaa7bdb816634529117dcfc4da26d26fdd )#0 MRBS\generate_backtrace() called at [/aytomad/app/mriam/web/functions_error.inc:152]

The user running the application dows not have indeed permissions to that folder. But when I tried to chage the default path I add this line ti the application config.inc.php : $session.save_path = "/aytomad/app/mriam/session"; I created the folder winth right permission but nothing occurs; no errors but not working. Is the sintaxis correct?

Original comment by: *anonymous

jberanek commented 3 years ago

No, the syntax is not correct. The session.save_path is set in your php.ini file, not the MRBS config file.

However, I'm a little puzzled as to why it's trying to use a session file at all. In MRBS 1.9.x the sessions are held in the database, not in the file system, precisely to avoid this kind of problem.

Was that the full error message, or was there more?

Original comment by: campbell-m

jberanek commented 3 years ago

Update: found this property in the pache php.conf but I can not edit the file for the moment. I will update when i wolud be possible.

Original comment by: *anonymous

jberanek commented 3 years ago

This is the full trace:.

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/ac0b5594fb/4e85/attachment/mriam_php_errors.txt

jberanek commented 3 years ago

Thanks. Were there any errors before that point? init.inc is run before upgrade.inc and I would have expected init.inc to generate an error.

Original comment by: campbell-m

jberanek commented 3 years ago

Find attached the two pages with the traces. The first prompts for database user/password. The second says the error " Su sesión ha caducado."

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/ac0b5594fb/71fa/attachment/Sistema%20de%20Reservas%20de%20Salas%20y%20Aulas_1.htm https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/ac0b5594fb/71fa/attachment/Sistema%20de%20Reservas%20de%20Salas%20y%20Aulas_2.htm

jberanek commented 3 years ago

What happens if you set

$auth["session"]="cookie";

Original comment by: campbell-m

jberanek commented 3 years ago

Thanks, commented that line in config.inc.php, but still have the message. But at removing the specific confguration in apache it worked!!. These are the lines I remove:

php_value session.save_handler "files"
php_value session.save_path    "/tmp"
php_value session.save_path    "/var/lib/php/session"
php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"

Thanks a lot.

Original comment by: *anonymous