Skip to content

🐛 [Bug] USER_CONFIG_TYPE=BD with pgsql cause 500 Error #1544

@ljcbaby

Description

@ljcbaby

🐛 Bug

it seems config decode error.

logs here

NOTICE: PHP message: PHP Warning:  Undefined variable $config in /usr/local/share/cypht/site/index.php on line 57
NOTICE: PHP message: PHP Stack trace:
NOTICE: PHP message: PHP   1. {main}() /usr/local/share/cypht/site/index.php:0
127.0.0.1 -  11/Jun/2025:22:40:44 +0800 "GET /index.php" 200
NOTICE: PHP message: Array
(
    [0] => INFO: Using Hm_PHP_Session with Hm_Auth_DB
    [1] => INFO: Using DB user configuration
    [2] => WARNING: Already registered module for ajax_combined_message_list re-attempted: load_user_data
    [3] => WARNING: Already registered module for ajax_imap_debug re-attempted: profile_data
    [4] => WARNING: Already registered module for servers re-attempted: compose_profile_data
    [5] => INFO: Using sapi: fpm-fcgi
    [6] => INFO: Request type: HTTP
    [7] => INFO: Request path: /
    [8] => INFO: TLS request: 0
    [9] => INFO: Mobile request: 0
    [10] => INFO: Page ID: home
    [11] => INFO: Using Hm_Cache for cache
    [12] => DANGER: Redis connect failed
    [13] => INFO: CACHE backend using: memcache
    [14] => WARNING: TRANSLATION NOT FOUND :Cypht:
    [15] => WARNING: TRANSLATION NOT FOUND :Are you sure you want to delete this server? :
    [16] => WARNING: TRANSLATION NOT FOUND :You need to have Javascript enabled to use %s, sorry about that!:
    [17] => INFO: PHP version 8.1.32
    [18] => INFO: Zend version 4.1.32
    [19] => INFO: Peak Memory: 16384
    [20] => INFO: PID: 1874
    [21] => INFO: Included files: 147
)
192.168.2.8 - - [11/Jun/2025:22:40:44 +0800] "GET / HTTP/1.1" 200 167633 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0"
127.0.0.1 -  11/Jun/2025:22:40:47 +0800 "POST /index.php" 500
NOTICE: PHP message: PHP Fatal error:  Uncaught TypeError: base64_decode(): Argument #1 ($string) must be of type string, resource given in /usr/local/share/cypht/lib/crypt_sodium.php:28
Stack trace:
#0 /usr/local/share/cypht/lib/crypt_sodium.php(28): base64_decode()
#1 /usr/local/share/cypht/lib/config.php(362): Hm_Crypt::plaintext()
#2 /usr/local/share/cypht/lib/config.php(387): Hm_User_Config_DB->decrypt_settings()
#3 /usr/local/share/cypht/modules/core/handler_modules.php(704): Hm_User_Config_DB->load()
#4 /usr/local/share/cypht/lib/modules_exec.php(177): Hm_Handler_load_user_data->process()
#5 /usr/local/share/cypht/lib/modules_exec.php(155): Hm_Module_Exec->run_handler_module()
#6 /usr/local/share/cypht/lib/dispatch.php(218): Hm_Module_Exec->run_handler_modules()
#7 /usr/local/share/cypht/lib/dispatch.php(188): Hm_Dispatch->process_request()
#8 /usr/local/share/cypht/site/index.php(55): Hm_Dispatch->__construct()
#9 {main}
  thrown in /usr/local/share/cypht/lib/crypt_sodium.php on line 28
192.168.2.8 - - [11/Jun/2025:22:40:48 +0800] "POST / HTTP/1.1" 500 11 "http://192.168.3.4:3008/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0"
NOTICE: PHP message: PHP Warning:  Undefined variable $config in /usr/local/share/cypht/site/index.php on line 57
NOTICE: PHP message: PHP Stack trace:
NOTICE: PHP message: PHP   1. {main}() /usr/local/share/cypht/site/index.php:0
127.0.0.1 -  11/Jun/2025:22:40:48 +0800 "GET /index.php" 200
NOTICE: PHP message: Array
(
    [0] => INFO: Using Hm_PHP_Session with Hm_Auth_DB
    [1] => INFO: Using DB user configuration
    [2] => WARNING: Already registered module for ajax_combined_message_list re-attempted: load_user_data
    [3] => WARNING: Already registered module for ajax_imap_debug re-attempted: profile_data
    [4] => WARNING: Already registered module for servers re-attempted: compose_profile_data
    [5] => INFO: Using sapi: fpm-fcgi
    [6] => INFO: Request type: HTTP
    [7] => INFO: Request path: /favicon.ico/
    [8] => INFO: TLS request: 0
    [9] => INFO: Mobile request: 0
    [10] => INFO: Page ID: home
    [11] => INFO: Using Hm_Cache for cache
    [12] => DANGER: Redis connect failed
    [13] => INFO: CACHE backend using: memcache
    [14] => INFO: Deleting cookie: name: hm_session, lifetime: 1749649248, path: /favicon.ico/, domain: 192.168.3.4, secure: , html_only 1
    [15] => INFO: Deleting cookie: name: hm_id, lifetime: 1749649248, path: /favicon.ico/, domain: 192.168.3.4, secure: , html_only 1
    [16] => INFO: Deleting cookie: name: hm_reload_folders, lifetime: 1749649248, path: , domain: 192.168.3.4, secure: , html_only 
    [17] => INFO: Deleting cookie: name: hm_msgs, lifetime: 1749649248, path: /favicon.ico/, domain: 192.168.3.4, secure: , html_only 1
    [18] => DANGER: HTTP header fingerprint check failed
    [19] => WARNING: TRANSLATION NOT FOUND :Cypht:
    [20] => WARNING: TRANSLATION NOT FOUND :Are you sure you want to delete this server? :
    [21] => WARNING: TRANSLATION NOT FOUND :You need to have Javascript enabled to use %s, sorry about that!:
    [22] => INFO: PHP version 8.1.32
    [23] => INFO: Zend version 4.1.32
    [24] => INFO: Peak Memory: 16384
    [25] => INFO: PID: 1874
    [26] => INFO: Included files: 147
)
192.168.2.8 - - [11/Jun/2025:22:40:48 +0800] "GET /favicon.ico HTTP/1.1" 200 167642 "http://192.168.3.4:3008/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0"
NOTICE: PHP message: PHP Warning:  Undefined variable $config in /usr/local/share/cypht/site/index.php on line 57
NOTICE: PHP message: PHP Stack trace:
NOTICE: PHP message: PHP   1. {main}() /usr/local/share/cypht/site/index.php:0
NOTICE: PHP message: Array
127.0.0.1 -  11/Jun/2025:22:40:53 +0800 "GET /index.php" 200
(
    [0] => INFO: Using Hm_PHP_Session with Hm_Auth_DB
    [1] => INFO: Using DB user configuration
    [2] => WARNING: Already registered module for ajax_combined_message_list re-attempted: load_user_data
    [3] => WARNING: Already registered module for ajax_imap_debug re-attempted: profile_data
    [4] => WARNING: Already registered module for servers re-attempted: compose_profile_data
    [5] => INFO: Using sapi: fpm-fcgi
    [6] => INFO: Request type: HTTP
    [7] => INFO: Request path: /
    [8] => INFO: TLS request: 0
    [9] => INFO: Mobile request: 0
    [10] => INFO: Page ID: home
    [11] => INFO: Using Hm_Cache for cache
    [12] => DANGER: Redis connect failed
    [13] => INFO: CACHE backend using: memcache
    [14] => WARNING: TRANSLATION NOT FOUND :Cypht:
    [15] => WARNING: TRANSLATION NOT FOUND :Are you sure you want to delete this server? :
    [16] => WARNING: TRANSLATION NOT FOUND :You need to have Javascript enabled to use %s, sorry about that!:
    [17] => INFO: PHP version 8.1.32
    [18] => INFO: Zend version 4.1.32
    [19] => INFO: Peak Memory: 16384
    [20] => INFO: PID: 1873
    [21] => INFO: Included files: 147
)
127.0.0.1 - - [11/Jun/2025:22:40:53 +0800] "GET / HTTP/1.1" 200 552198 "-" "curl/7.88.1"
NOTICE: PHP message: PHP Warning:  Undefined variable $config in /usr/local/share/cypht/site/index.php on line 57
NOTICE: PHP message: PHP Stack trace:
NOTICE: PHP message: PHP   1. {main}() /usr/local/share/cypht/site/index.php:0
127.0.0.1 -  11/Jun/2025:22:41:23 +0800 "GET /index.php" 200
NOTICE: PHP message: Array
(
    [0] => INFO: Using Hm_PHP_Session with Hm_Auth_DB
    [1] => INFO: Using DB user configuration
    [2] => WARNING: Already registered module for ajax_combined_message_list re-attempted: load_user_data
    [3] => WARNING: Already registered module for ajax_imap_debug re-attempted: profile_data
    [4] => WARNING: Already registered module for servers re-attempted: compose_profile_data
    [5] => INFO: Using sapi: fpm-fcgi
    [6] => INFO: Request type: HTTP
    [7] => INFO: Request path: /
    [8] => INFO: TLS request: 0
    [9] => INFO: Mobile request: 0
    [10] => INFO: Page ID: home
    [11] => INFO: Using Hm_Cache for cache
    [12] => DANGER: Redis connect failed
    [13] => INFO: CACHE backend using: memcache
    [14] => WARNING: TRANSLATION NOT FOUND :Cypht:
    [15] => WARNING: TRANSLATION NOT FOUND :Are you sure you want to delete this server? :
    [16] => WARNING: TRANSLATION NOT FOUND :You need to have Javascript enabled to use %s, sorry about that!:
    [17] => INFO: PHP version 8.1.32
    [18] => INFO: Zend version 4.1.32
    [19] => INFO: Peak Memory: 16384
    [20] => INFO: PID: 1874
    [21] => INFO: Included files: 147
)
127.0.0.1 - - [11/Jun/2025:22:41:23 +0800] "GET / HTTP/1.1" 200 552197 "-" "curl/7.88.1"

Version & Environment

Rev: [daily]

OS: [docker.io/cypht/cypht]

Metadata

Metadata

Assignees

Labels

bugsomething is wrong in Cypht

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions