By: Daniel Steiner user 31 Jan 2022 at 10:14 p.m. CST

15 Responses
Daniel Steiner gravatar
Hi, I tryed the upgrade from 4.3.0 to 4.3.1 using the script upg4xto431.py. But during update, I get following errror: ``` Extracting CES package Extracting sqlalchemy Please wait while collecting properties... Traceback (most recent call last): File "upg4xto431.py", line 1627, in <module> updaterObj.prepare_ces() File "upg4xto431.py", line 460, in prepare_ces collectProperties.collect() File "/install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py", line 206, in collect if 'ScimProperties' in oxTrustConfApplication and 'protectionMode' in oxTrustConfApplication['ScimProperties']: TypeError: argument of type 'NoneType' is not iterable ``` After cleanup, the gluu service is still working fine with 4.3.0. Regards, Daniel

By Mohib Zico staff 31 Jan 2022 at 11:03 p.m. CST

Mohib Zico gravatar
Checking....

By Mustafa Baser staff 01 Feb 2022 at 9:01 a.m. CST

Mustafa Baser gravatar
Hi Daniel, I performed upgrade from 4.3.0 to 4.3.1 bot on Ubunu20 and CentOS8. Both went well. Was your server upgraded before from a 3.x version? Regards.

By Daniel Steiner user 01 Feb 2022 at 9:06 a.m. CST

Daniel Steiner gravatar
Hi Mustafa, No, 4.3.0 was a fresh installation. Can I get somewhere more information about the update (logs, ...)? But, I also have updated another instance without any problem, only one difference: The other (working) instance has no SAML configuration active. Regards, Daniel

By Mustafa Baser staff 02 Feb 2022 at 4:09 a.m. CST

Mustafa Baser gravatar
Hi, Please replace this file `/install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py` with the one attached and re-run upgrade script.

By Daniel Steiner user 02 Feb 2022 at 11:49 a.m. CST

Daniel Steiner gravatar
Hi, Thank you, I will try it tomorrow morning. I'll let you know ... Daniel

By Daniel Steiner user 02 Feb 2022 at 11:34 p.m. CST

Daniel Steiner gravatar
Hi Mustafa, I changed the collect_properties.py file with the one you have provided. Now, I have a different error: ``` ... Traceback (most recent call last): File "upg4xto431.py", line 1627, in <module> updaterObj.prepare_ces() File "upg4xto431.py", line 460, in prepare_ces collectProperties.collect() File "/install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py", line 216, in collect Config.scim_rs_client_jks_pass = self.unobscure(oxTrustConfApplication['scimUmaClientKeyStorePassword']) File "/install/community_edition_setup_4.3.1/setup_app/utils/crypto64.py", line 39, in unobscure decrypted = cipher.decrypt(base64.b64decode(data), padmode=PAD_PKCS5) File "/usr/lib64/python3.6/base64.py", line 80, in b64decode s = _bytes_from_decode_data(s) File "/usr/lib64/python3.6/base64.py", line 46, in _bytes_from_decode_data "string, not %r" % s.__class__.__name__) from None TypeError: argument should be a bytes-like object or ASCII string, not 'NoneType' ``` Here is the difference of the replaced script: ``` diff install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py.orig install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py 206c206 < if 'ScimProperties' in oxTrustConfApplication and 'protectionMode' in oxTrustConfApplication['ScimProperties']: --- > if 'ScimProperties' in oxTrustConfApplication and oxTrustConfApplication['ScimProperties'] and 'protectionMode' in oxTrustConfApplication['ScimProperties']: ``` Thank you, Regards, Daniel

By Mustafa Baser staff 03 Feb 2022 at 2:55 a.m. CST

Mustafa Baser gravatar
Hi, Your installation is somehow is different. Since I don't know what is different, I am not able to fix it. How did you install 4.0? With a `setup.properties` ? Regards.

By Daniel Steiner user 03 Feb 2022 at 7:32 a.m. CST

Daniel Steiner gravatar
Hi Mustafa, Do you mean we did the installation not in interactive mode using the prepared `setup.properties` file? We did the install using the interactive mode without the file. If I analyze the python traceback, it tries to decrypt the `scimUmaClientKeyStorePassword` entry. But, we did not specifay that parameter in the Gluu json configuration. We are not using UMA at all. Regards, Daniel

By Daniel Steiner user 03 Feb 2022 at 7:48 a.m. CST

Daniel Steiner gravatar
Hi Mustafa, Very strange, we have another Gluuserver (for testing purposes). But the setup is quite similar to the production server. We also tried the setup script and get a different error: ``` Extracting sqlalchemy Please wait while collecting properties... Traceback (most recent call last): File "upg4xto431.py", line 1643, in <module> updaterObj.prepare_ces() File "upg4xto431.py", line 460, in prepare_ces collectProperties.collect() File "/install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py", line 148, in collect if 'gluuIpAddress' in oxConfiguration: TypeError: argument of type 'NoneType' is not iterable ``` Note: We did not replace the modified `collect_properties.py` script for this update! Regards, Daniel

By Chung Kaili user 03 Feb 2022 at 9:43 a.m. CST

Chung Kaili gravatar
Hi everyone I encountered the same problem. Changing two lines in the update code shown below fixed it for me. The reason for the error is that the dict `oxTrustConfApplication` contains the keys `scimUmaClientKeyStorePassword` and `ScimProperties` but the value is `None` The script expects a valid value which leads to the errors. Therefore I just added an additional check in the problematic if statements to check if the value is `None`: File `/install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py:` Line 218: ``` if 'scimUmaClientKeyStorePassword' in oxTrustConfApplication` ``` changed to ``` if 'scimUmaClientKeyStorePassword' in oxTrustConfApplication and oxTrustConfApplication.get('scimUmaClientKeyStorePassword') is not None: ``` File `/install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py` Line 208: ``` if 'ScimProperties' in oxTrustConfApplication and 'protectionMode' in oxTrustConfApplication['ScimProperties']: ``` changed to ``` if 'ScimProperties' in oxTrustConfApplication and oxTrustConfApplication.get('ScimProperties') is not None and 'protectionMode' in oxTrustConfApplication['ScimProperties']: ``` I'm not sure if this is a safe way to mitigate the problem, maybe a staff can confirm this as a valid solution? Regards

By Daniel Steiner user 04 Feb 2022 at 6:34 a.m. CST

Daniel Steiner gravatar
Hi Chung, Thank you for your response, I will try that next monday morning. I'll let you know about the result. Regards

By Daniel Steiner user 06 Feb 2022 at 9:55 p.m. CST

Daniel Steiner gravatar
Hi, The update worked fine. I provide here the patch file for the required changes: ``` --- install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py.orig 2022-02-02 17:52:33.763330730 +0000 +++ install/community_edition_setup_4.3.1/setup_app/utils/collect_properties.py 2022-02-07 03:33:36.743045055 +0000 @@ -203,7 +203,7 @@ if 'scimUmaResourceId' in oxTrustConfApplication: Config.scim_resource_oxid = oxTrustConfApplication['scimUmaResourceId'] - if 'ScimProperties' in oxTrustConfApplication and 'protectionMode' in oxTrustConfApplication['ScimProperties']: + if 'ScimProperties' in oxTrustConfApplication and oxTrustConfApplication.get('ScimProperties') is not None and 'protectionMode' in oxTrustConfApplication['ScimProperties']: Config.scim_protection_mode = oxTrustConfApplication['ScimProperties']['protectionMode'] else: Config.scim_protection_mode = 'OAUTH' @@ -212,7 +212,7 @@ Config.api_rp_client_jks_pass = self.unobscure(oxTrustConfApplication['apiUmaClientKeyStorePassword']) Config.api_rs_client_jks_fn = oxTrustConfApplication['apiUmaClientKeyStoreFile'] - if 'scimUmaClientKeyStorePassword' in oxTrustConfApplication: + if 'scimUmaClientKeyStorePassword' in oxTrustConfApplication and oxTrustConfApplication.get('scimUmaClientKeyStorePassword') is not None: Config.scim_rs_client_jks_pass = self.unobscure(oxTrustConfApplication['scimUmaClientKeyStorePassword']) Config.scim_rs_client_jks_fn = str(oxTrustConfApplication['scimUmaClientKeyStoreFile']) ``` Gluu team: Please can you add this patch? Regards

By Mohib Zico staff 06 Feb 2022 at 10:22 p.m. CST

Mohib Zico gravatar
Hello Daniel, Can you please add a pull request [here](https://github.com/GluuFederation/community-edition-setup/pulls) with your fix? Thanks much for your help!

By Daniel Steiner user 06 Feb 2022 at 10:53 p.m. CST

Daniel Steiner gravatar
Hi, Pull request created: https://github.com/GluuFederation/community-edition-setup/pull/809 Regards

By Mustafa Baser staff 07 Feb 2022 at 3:36 a.m. CST

Mustafa Baser gravatar
Daniel, Please see my comment on the pull request. Regards.