Page 1 of 1

Cannot add subdomain

Posted: Mon 9. Sep 2024, 15:07
by akong77
Hello,
My server is ubuntu 22.04 and keyhelp is 24.2.
I want add subdomain bit it's will show blank page and show http 500 error.
How to fix it?

Re: Cannot add subdomain

Posted: Mon 9. Sep 2024, 15:09
by Florian
Hello,

check the error log of the subdomain.

Re: Cannot add subdomain

Posted: Mon 9. Sep 2024, 15:20
by Alexander
Hello,

If you get the error 500 when visiting the subdomain, do as Florian said.

If you encounter the error 500 in KeyHelp, please check the KeyHelp error log (/var/log/keyhelp/php-error.log)

Re: Cannot add subdomain

Posted: Mon 9. Sep 2024, 15:36
by akong77
How to find this error log?I has try search keyword but not found.

Re: Cannot add subdomain

Posted: Mon 9. Sep 2024, 15:38
by akong77
[09-Sep-2024 21:37:37 Asia/Taipei] PHP Fatal error: Uncaught TypeError: SelfStoringObject::loadByIdAndIdUser(): Argument #1 ($id) must be of type int, null given, called in /home/keyhelp/www/keyhelp/pages/domains.php on line 1116 and defined in /home/keyhelp/www/keyhelp/core/Generic/SelfStoringObject.php:382
Stack trace:
#0 /home/keyhelp/www/keyhelp/pages/domains.php(1116): SelfStoringObject::loadByIdAndIdUser()
#1 /home/keyhelp/www/keyhelp/index.php(438): unknown()
#2 {main}
thrown in /home/keyhelp/www/keyhelp/core/Generic/SelfStoringObject.php on line 382

Re: Cannot add subdomain

Posted: Mon 9. Sep 2024, 15:53
by Alexander
Seems your KeyHelp database (Table `Domain`) has at least one record with a wrong ID in it.

Can you add subdomains to other domains on your server? Any ideas how it happend (restore a backup, manual edits to the database, etc.)?

I can investigate and fix it, if you can send me the database credentials to the KeyHelp Database (or root database credentials) and KeyHelp login credentials via private message.

Re: Cannot add subdomain

Posted: Mon 9. Sep 2024, 18:36
by akong77
I has post private message for you.
Please help me to fix it.Thanks a lot.

Re: Cannot add subdomain

Posted: Tue 10. Sep 2024, 03:21
by akong77
Cloud have fix done?I has tested it's normal create subdomain.

Re: Cannot add subdomain

Posted: Tue 10. Sep 2024, 10:23
by Alexander
The problem is solved.

There was one client, who could not add a subdomain to one of its domains (and it resulted in a error 500).

My first guess, the IDs in the database were off, was wrong, all IDs seems to be fine.
I did not had SSH access to the server, so i "played" around in the KeyHelp UI and somehow was able to fix it, but i could not investigate the real reason behind (due to missing SSH access).

I added a subdomain for this particular client via the admin area -> that worked.
Than i deleted this domain and went to the client and tried again to add a subdomain, and now this also worked.
- Kind of strange, but so i will not be able to reproduce the problem anymore.

Re: Cannot add subdomain

Posted: Thu 17. Oct 2024, 16:45
by mizael
Alexander wrote: Tue 10. Sep 2024, 10:23 The problem is solved.

There was one client, who could not add a subdomain to one of its domains (and it resulted in a error 500).

My first guess, the IDs in the database were off, was wrong, all IDs seems to be fine.
I did not had SSH access to the server, so i "played" around in the KeyHelp UI and somehow was able to fix it, but i could not investigate the real reason behind (due to missing SSH access).

I added a subdomain for this particular client via the admin area -> that worked.
Than i deleted this domain and went to the client and tried again to add a subdomain, and now this also worked.
- Kind of strange, but so i will not be able to reproduce the problem anymore.
i was able to reproduce the error by not selecting a domain and saving anyway, resulting in server error 500

Image

Re: Cannot add subdomain  [SOLVED]

Posted: Fri 18. Oct 2024, 09:59
by Alexander
Ahhh, nice catch, thank you very much!

A classic regression bug :). I have fixed it for the upcoming KeyHelp version.

Thank you!