Error 500 to login page

Sirs,
we have a server with hestiaCP installed for months that we haven’t accessed for a long time. Today I tried to access and I have the following error in the logs:

2023/09/05 20:40:44 [error] 875#0: *21 FastCGI sent in stderr: "PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/inc/main.php on line 524; PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /usr/local/hestia/web/inc/main.php on line 525; PHP message: PHP Warning: Undefined array key "RELEASE_BRANCH" in /usr/local/hestia/web/inc/main.php on line 105; PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/inc/main.php on line 524; PHP message: PHP Warning: foreach() argument must be of type array|object, null given in /usr/local/hestia/web/inc/main.php on line 525; PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/login/index.php on line 437; PHP message: PHP Warning: Trying to access array offset on value of type null in /usr/local/hestia/web/login/index.php on line 437; PHP message: PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /usr/local/hestia/web/login/index.php:442 Stack trace: #0 /usr/local/hestia/web/login/index.php(442): in_array() #1 {main} thrown in /usr/local/hestia/web/login/index.php on line 442" while reading response header from upstream, client: XXX.XX.89.7, server: _, request: "GET /login/ HTTP/2.0", upstream: "fastcgi://unix:/run/hestia-php.sock:", host: "XX.XXX.XX.117:8083"

Has anyone had this problem and can help me understand and resolve?

Thanks

Hello @fabwebbr,

All those messages are related to the execution of command v-list-sys-config json

What is the output of this command?

/usr/local/hestia/bin/v-list-sys-config json

Cheers,
sahsanu

Hello @sahsanu , this is the output:

{
                "config": {
                        "WEB_SYSTEM": "apache2",
                        "WEB_RGROUPS": "www-data",
                        "WEB_PORT": "8080",
                        "WEB_SSL": "mod_ssl",
                        "WEB_SSL_PORT": "8443",
                        "WEB_BACKEND": "php-fpm",
                        "PROXY_SYSTEM": "nginx",
                        "PROXY_PORT": "80",
                        "PROXY_SSL_PORT": "443",
                        "FTP_SYSTEM": "vsftpd",
                        "MAIL_SYSTEM": "exim4",
                        "IMAP_SYSTEM": "dovecot",
                        "ANTIVIRUS_SYSTEM": "",
                        "ANTISPAM_SYSTEM": "spamassassin",
                        "DB_SYSTEM": "mysql",
                        "DNS_SYSTEM": "bind9",
                        "DNS_CLUSTER": "",
                        "DNS_CLUSTER_SYSTEM": "hestia",
                        "SUPPORT_DNSSEC": "no",
                        "STATS_SYSTEM": "awstats",
                        "BACKUP_SYSTEM": "local",
                        "CRON_SYSTEM": "cron",
                        "DISK_QUOTA": "no",
                        "FIREWALL_SYSTEM": "iptables",
                        "FIREWALL_EXTENSION": "fail2ban",
                        "FILE_MANAGER": "true",
                        "REPOSITORY": "",
                        "VERSION": "1.8.7",
                        "RELEASE_BRANCH": "release",
                        "UPGRADE_SEND_EMAIL": "true",
                        "UPGRADE_SEND_EMAIL_LOG": "false",
                        "SMTP_RELAY": "",
                        "SMTP_RELAY_HOST": "",
                        "SMTP_RELAY_PORT": "",
                        "SMTP_RELAY_USER": "",
                        "DEMO_MODE": "",
                        "THEME": "dark",
                        "LANGUAGE": "en",
                        "BACKUP_GZIP": "4",
                        "BACKUP": "/backup",
                        "BACKUP_MODE": "zstd",
                        "WEBMAIL_ALIAS": "webmail",
                        "WEBMAIL_SYSTEM": "roundcube",
                        "DB_PMA_ALIAS": "phpmyadmin",
                        "DB_PGA_ALIAS": "",
                        "LOGIN_STYLE": "default",
                        "INACTIVE_SESSION_TIMEOUT": "60",
                        "PHPMYADMIN_KEY": "",
                        "ENFORCE_SUBDOMAIN_OWNERSHIP": "yes",
                        "DEBUG_MODE": "false",
                        "API": "yes",
                        "API_SYSTEM": "1",
                        "API_ALLOWED_IP": "",
                        "UPDATE_AVAILABLE": "",
                        "PLUGIN_APP_INSTALLER": "true",
                        "PLUGIN_FILE_MANAGER": "",
                        "POLICY_SYSTEM_ENABLE_BACON": "false",
                        "POLICY_SYSTEM_PROTECTED_ADMIN": "yes",
                        "POLICY_SYSTEM_HIDE_ADMIN": "no",
                        "POLICY_SYSTEM_HIDE_SERVICES": "no",
                        "POLICY_SYSTEM_PASSWORD_RESET": "yes",
                        "POLICY_USER_VIEW_SUSPENDED": "",
                        "POLICY_BACKUP_SUSPENDED_USERS": "no",
                        "POLICY_USER_EDIT_DETAILS": "yes",
                        "POLICY_USER_EDIT_WEB_TEMPLATES": "yes",
                        "POLICY_USER_EDIT_DNS_TEMPLATES": "yes",
                        "POLICY_USER_DELETE_LOGS": "yes",
                        "POLICY_USER_VIEW_LOGS": "yes",
                        "POLICY_USER_CHANGE_THEME": "yes",
                        "POLICY_CSRF_STRICTNESS": "1",
                        "POLICY_SYNC_SKELETON": "yes",
                        "POLICY_SYNC_ERROR_DOCUMENTS": "yes",
                        "USE_SERVER_SMTP": "false",
                        "SERVER_SMTP_HOST": "",
                        "SERVER_SMTP_PORT": "",
                        "SERVER_SMTP_SECURITY": "",
                        "SERVER_SMTP_USER": "",
                        "SERVER_SMTP_PASSWD": "",
                        "SERVER_SMTP_ADDR": "",
                        "DISABLE_IP_CHECK": "no",
                        "FROM_NAME": "",
                        "FROM_EMAIL": "",
                        "APP_NAME": "Hestia Control Panel",
                        "TITLE": "{{page}} - {{hostname}} - {{appname}}",
                        "SUBJECT_EMAIL": "{{subject}}",
                        "HIDE_DOCS": "no"
                }
        }

I see no problem.

Maybe you should check the service status and hestia-nginx conf.

systemctl status hestia.service
/usr/local/hestia/nginx/sbin/hestia-nginx -t

If all look fine, try to restart hestia-nginx.

systemctl restart hestia.service

Add

var_dump($output); on the line between:

1 Like

Guys,
I think I found the problem! I had put the user “admin” in sudoers and when I ran the “systemctl status hestia.service” I noticed an error about admin authentication.

I removed the admin from sudoers and the panel worked correctly again.

(Sorry my poor english)

1 Like

Glad you get it working again.

What did you remove? I mean, Hestia creates a file /etc/sudoers.d/admin with this content:

# Created by hestia installer
Defaults env_keep="VESTA"
Defaults env_keep+="HESTIA"
Defaults:admin !syslog
Defaults:admin !requiretty
Defaults:root !requiretty

# sudo is limited to hestia scripts
admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
admin   ALL=NOPASSWD:/usr/local/hestia/bin/*

So I suppose you added the admin user to /etc/sudoers file? I’m asking just to get all the info in case any other user has the same problem and reach this post.

Cheers,
sahsanu

@sahsanu That’s right. I wasn’t aware of the admin user in /etc/sudoers.d/admin and so I manually added it in /etc/sudoers and that was the whole problem then.

1 Like