su: cannot open session: Module is unknown
The upgrade issue arises in several linux editions such as RHEL and CentOS when the bundled postgres database needs to be upgraded in that particular patch and the upgrade is triggered by the root user.
The highlighted line in the traces below (su: cannot open session: Module is unknown) identifies this specific upgrade failure instance.
Log Traces:
- Oct 27, 2023 4:13:06 PM [pglog] [INFO] : su: cannot open session: Module is unknown
- ............
- ............
- Oct 12, 2023 4:13:06 PM [com.adventnet.persistence.DefaultPreProcessor] [INFO] : Exception occured while initializing
- Oct 12, 2023 4:13:06 PM [SYSERR] [INFO] : java.net.ConnectException: Trying to start PostgresSQL server failed
- Oct 12, 2023 4:13:06 PM [SYSERR] [INFO] : at com.adventnet.db.adapter.postgres.DefaultPostgresDBInitializer.startDBServer(DefaultPostgresDBInitializer.java:201)
- Oct 12, 2023 4:13:06 PM [SYSERR] [INFO] : at com.adventnet.db.adapter.postgres.PostgresDBAdapter.startAndCheckDBServer(PostgresDBAdapter.java:781)
( or )
- Aug 12, 2023 4:13:06 PM [pglog] [INFO] : su: cannot open session: Module is unknown
- ............
- ............
- Aug 12, 2023 6:16:50 AM [com.adventnet.persistence.PostgresPreProcessor] [SEVERE] : PostgreSQL Server has not shutdown properly with pg_isready state :: [0]
- Aug 12, 2023 6:16:50 AM [com.adventnet.persistence.PostgresPreProcessor] [SEVERE] : {0}java.lang.Exception: PostgreSQL Server was not stopped properly
- at com.adventnet.persistence.PostgresPreProcessor.checkPostgresServerStatus(PostgresPreProcessor.java:1902)

Workaround 1
- Initiate the upgrade process as normal user with all privilege to the ServiceDesk directory

Note:
- If the application is already started using root user, then majority of the file ownership will be changed to root, so make sure if the proper privilege is given to that normal user. Make use of the below command to change the permission to normal user.
- chown -R <normal user name> : <normal user group> <product_installation_location>
- For Example,
- chown -R admin:admin_ubuntu ServiceDesk
- If any permission issue is occurring then the normal user can make a copy of the ServiceDesk directory in a different folder and then initiate the upgrade proces.
- run ./initpgsql.sh once, if it completed successfully, you are good to proceed with upgrade. otherwise, need to check the permissions.
(or)

Workaround 2:
- Please navigate to <product_installation_directory>/bin directory in your server.
- Take a backup of UpdateManager.sh script file.
- Open that file and comment out the below lines by adding the #(hash) in front and save the file.
- LD_LIBRARY_PATH=$DB_HOME/lib/:./lib/native:$LD_LIBRARY_PATH
- export LD_LIBRARY_PATH
Ex: After commenting out, it will look like,
- #LD_LIBRARY_PATH=$DB_HOME/lib/:./lib/native:$LD_LIBRARY_PATH
- #export LD_LIBRARY_PATH
4. Initiate the upgrade process.
New to ADSelfService Plus?