Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration serveur + blockedlog #13233

Closed
webrdinfo opened this issue Feb 28, 2020 · 2 comments
Closed

Migration serveur + blockedlog #13233

webrdinfo opened this issue Feb 28, 2020 · 2 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@webrdinfo
Copy link

Bug

Suite migration un dolibarr v10.0.1 d’un serveur sur un autre, tous les logs inéaltérables précédents sont en rouge (notés corrompus), puis le premier log suivant affiche dans l’infobulle « Le journal archivé semble valide par rapport au précédent mais la chaîne était corrompue auparavant » :
https://www.dolibarr.fr/forum/t/migration-serveur-blockedlog/32094

Environment

  • Version: 11.0.1
  • OS: Linux Centox 8
  • Web server: Apache 2.4
  • PHP: 7.4
  • Database: Mariadb
@webrdinfo webrdinfo added the Bug This is a bug (something does not work as expected) label Feb 28, 2020
@eldy
Copy link
Member

eldy commented Mar 3, 2020

Can you compare the 2 first lines of table llx_blockedlog to see how it is in old database and in new database ? Is there any difference of 11 byte between following fields :
date_creation action amounts ref_object date_object user_fullname object_data

If it is similar (check seriously field object_data), can you tell if you change your PHP version. From which version to which version ?

Can you compare the timezone of the PHP, and the timezone of the Database.

Finally can your run this command lien program on your old environment and on your new one and cut and past results for both:
https://github.com/Dolibarr/dolibarr/blob/develop/test/test_serialize.php

@webrdinfo
Copy link
Author

webrdinfo commented Mar 13, 2020

Hello eldy,

Thank you for your return and your script, here is the result:

Old server:

#!/usr/bin/env php
*** PHP Version : 5.6.38 - Dolibarr Version : 11.0.2
*** print_r() of object used to generate the key to hash for blockedlog on the object sample: stdClass Object ( [aaa] => aaa [bbb] => bbb [thirdparty] => stdClass Object ( [name] => MyBigCompany [name_alias] => [address] => [zip] => [town] => [state_code] => [ref_ext] => [country_code] => ) ) *** We build hash(256) of this string: 30829c63f27a84dff489bb054c6e86aabbbcdba644db9e09ab459092ef1bf28a
*** When it is serialized() to store in db, we got: O:8:"stdClass":3:{s:3:"aaa";s:3:"aaa";s:3:"bbb";s:3:"bbb";s:10:"thirdparty";O:8:"stdClass":8:{s:4:"name";s:12:"MyBigCompany";s:10:"name_alias";N;s:7:"address";N;s:3:"zip";N;s:4:"town";N;s:10:"state_code";N;s:7:"ref_ext";N;s:12:"country_code";N;}}
*** And when it is print_r(unserialized()) to reuse it: stdClass Object ( [aaa] => aaa [bbb] => bbb [thirdparty] => stdClass Object ( [name] => MyBigCompany [name_alias] => [address] => [zip] => [town] => [state_code] => [ref_ext] => [country_code] => ) )
*** We build hash(256) of this string: 30829c63f27a84dff489bb054c6e86aabbbcdba644db9e09ab459092ef1bf28a

New server:

#!/usr/bin/env php
*** PHP Version : 7.4.1 - Dolibarr Version : 11.0.2
*** print_r() of object used to generate the key to hash for blockedlog on the object sample: stdClass Object ( [aaa] => aaa [bbb] => bbb [thirdparty] => stdClass Object ( [name] => MyBigCompany [name_alias] => [address] => [zip] => [town] => [state_code] => [ref_ext] => [country_code] => ) ) *** We build hash(256) of this string: 30829c63f27a84dff489bb054c6e86aabbbcdba644db9e09ab459092ef1bf28a
*** When it is serialized() to store in db, we got: O:8:"stdClass":3:{s:3:"aaa";s:3:"aaa";s:3:"bbb";s:3:"bbb";s:10:"thirdparty";O:8:"stdClass":8:{s:4:"name";s:12:"MyBigCompany";s:10:"name_alias";N;s:7:"address";N;s:3:"zip";N;s:4:"town";N;s:10:"state_code";N;s:7:"ref_ext";N;s:12:"country_code";N;}}
*** And when it is print_r(unserialized()) to reuse it: stdClass Object ( [aaa] => aaa [bbb] => bbb [thirdparty] => stdClass Object ( [name] => MyBigCompany [name_alias] => [address] => [zip] => [town] => [state_code] => [ref_ext] => [country_code] => ) )
*** We build hash(256) of this string: 30829c63f27a84dff489bb054c6e86aabbbcdba644db9e09ab459092ef1bf28a

in addition, I changed the time zone in php.ini on the new server with the same as the old one.
I updated dolibarr to version 11.0.2 on the 2 servers and I no longer have a problem with unalterable logs.

thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

2 participants