[GH-ISSUE #59] 500 Internal Server Error #34

Open
opened 2026-03-02 03:21:25 +03:00 by kerem · 13 comments
Owner

Originally created by @krlex on GitHub (Aug 21, 2022).
Original GitHub issue: https://github.com/clonos/control-pane/issues/59

Originally assigned to: @olevole on GitHub.

Hello,
I try to install ClonOS in VM.
I use Instructions from https://clonos.convectix.com/installation_on_freebsd.html
And I configure CBSD over reggae. So ~cbsd/etc/ is /usr/cbsd/etc
Can you help me how find more logs to send you if I can't solve it problem.
Thanks in advance

Error

Originally created by @krlex on GitHub (Aug 21, 2022). Original GitHub issue: https://github.com/clonos/control-pane/issues/59 Originally assigned to: @olevole on GitHub. Hello, I try to install ClonOS in VM. I use Instructions from https://clonos.convectix.com/installation_on_freebsd.html And I configure CBSD over reggae. So `~cbsd/etc/ `is ` /usr/cbsd/etc` Can you help me how find more logs to send you if I can't solve it problem. Thanks in advance ![Error](https://user-images.githubusercontent.com/6898734/185794200-0601c746-4bb9-46da-98d7-5b780cf65b33.png)
Author
Owner

@G0Dzilla1984 commented on GitHub (Aug 29, 2022):

Hello. I've got same error.
In nginx logs I can see next:
2022/08/29 16:58:28 [error] 40043#100867: *11 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/clonos/php/db.php:136 Stack trace: #0 /usr/local/www/clonos/public/pages/overview/a.json.php(17): Db->select() #1 /usr/local/www/clonos/php/clonos.php(265): include('...') #2 /usr/local/www/clonos/php/clonos.php(152): ClonOS->ccmd_getJsonPage() #3 /usr/local/www/clonos/public/json.php(12): ClonOS->__construct() #4 {main} thrown in /usr/local/www/clonos/php/db.php on line 136" while reading response header from upstream, client: bsdman.local, server: _, request: "POST /json.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "cbsd.local", referrer: "http://cbsd.local/overview/"

<!-- gh-comment-id:1230352661 --> @G0Dzilla1984 commented on GitHub (Aug 29, 2022): Hello. I've got same error. In nginx logs I can see next: `2022/08/29 16:58:28 [error] 40043#100867: *11 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/clonos/php/db.php:136 Stack trace: #0 /usr/local/www/clonos/public/pages/overview/a.json.php(17): Db->select() #1 /usr/local/www/clonos/php/clonos.php(265): include('...') #2 /usr/local/www/clonos/php/clonos.php(152): ClonOS->ccmd_getJsonPage() #3 /usr/local/www/clonos/public/json.php(12): ClonOS->__construct() #4 {main} thrown in /usr/local/www/clonos/php/db.php on line 136" while reading response header from upstream, client: bsdman.local, server: _, request: "POST /json.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "cbsd.local", referrer: "http://cbsd.local/overview/"`
Author
Owner

@bozhinov commented on GitHub (Aug 29, 2022):

This is fixable but the question is how stable is the code atm with the upcoming release and all

<!-- gh-comment-id:1230588489 --> @bozhinov commented on GitHub (Aug 29, 2022): This is fixable but the question is how stable is the code atm with the upcoming release and all
Author
Owner

@olevole commented on GitHub (Aug 29, 2022):

I unfortunately still don't have a server to continue developing.
Сan you set up the error logging in php to a file and try again, e.g:

/usr/local/etc/php.ini

error_log = /var/log/php/php.err

then:

mkdir /var/log/php
touch /var/log/php/php.err
chown www:www /var/log/php/php.err
service php-fpm restart

Also please check sudo file for www user: /usr/local/etc/sudoers.d/10_www
and additional group for www user: this user must be a member of the 'cbsd' group to be able to read the SQLite3 database ( /usr/jails/var/db/local.sqlite )

<!-- gh-comment-id:1230853117 --> @olevole commented on GitHub (Aug 29, 2022): I unfortunately still don't have a server to continue developing. Сan you set up the error logging in php to a file and try again, e.g: /usr/local/etc/php.ini ``` error_log = /var/log/php/php.err ``` then: ``` mkdir /var/log/php touch /var/log/php/php.err chown www:www /var/log/php/php.err service php-fpm restart ``` Also please check sudo file for www user: /usr/local/etc/sudoers.d/10_www and additional group for `www` user: this user must be a member of the 'cbsd' group to be able to read the SQLite3 database ( /usr/jails/var/db/local.sqlite )
Author
Owner

@G0Dzilla1984 commented on GitHub (Aug 30, 2022):

Maybe it might help:

[30-Aug-2022 18:19:49 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$_vars is deprecated in /usr/local/www/clonos/php/clonos.php on line 62
[30-Aug-2022 18:19:49 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$config is deprecated in /usr/local/www/clonos/php/clonos.php on line 95
[30-Aug-2022 18:19:49 UTC] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/clonos/php/db.php:136
Stack trace:
#0 /usr/local/www/clonos/php/config.php(334): Db->select()
#1 /usr/local/www/clonos/public/dialogs/bhyve-new.php(29): Config->vm_packages_list()
#2 /usr/local/www/clonos/php/clonos.php(2029): include('...')
#3 /usr/local/www/clonos/public/index.php(101): ClonOS->placeDialogs()
#4 {main}
thrown in /usr/local/www/clonos/php/db.php on line 136
[30-Aug-2022 18:19:50 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$_vars is deprecated in /usr/local/www/clonos/php/clonos.php on line 62
[30-Aug-2022 18:19:50 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$config is deprecated in /usr/local/www/clonos/php/clonos.php on line 95
[30-Aug-2022 18:19:50 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$mode is deprecated in /usr/local/www/clonos/php/clonos.php on line 118
[30-Aug-2022 18:19:50 UTC] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/clonos/php/db.php:136
Stack trace:
#0 /usr/local/www/clonos/public/pages/bhyvevms/a.json.php(7): Db->select()
#1 /usr/local/www/clonos/php/clonos.php(265): include('...')
#2 /usr/local/www/clonos/php/clonos.php(152): ClonOS->ccmd_getJsonPage()
#3 /usr/local/www/clonos/public/json.php(12): ClonOS->__construct()
#4 {main}
thrown in /usr/local/www/clonos/php/db.php on line 136

<!-- gh-comment-id:1232010343 --> @G0Dzilla1984 commented on GitHub (Aug 30, 2022): Maybe it might help: > [30-Aug-2022 18:19:49 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$_vars is deprecated in /usr/local/www/clonos/php/clonos.php on line 62 > [30-Aug-2022 18:19:49 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$config is deprecated in /usr/local/www/clonos/php/clonos.php on line 95 > [30-Aug-2022 18:19:49 UTC] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/clonos/php/db.php:136 > Stack trace: > #0 /usr/local/www/clonos/php/config.php(334): Db->select() > #1 /usr/local/www/clonos/public/dialogs/bhyve-new.php(29): Config->vm_packages_list() > #2 /usr/local/www/clonos/php/clonos.php(2029): include('...') > #3 /usr/local/www/clonos/public/index.php(101): ClonOS->placeDialogs() > #4 {main} > thrown in /usr/local/www/clonos/php/db.php on line 136 > [30-Aug-2022 18:19:50 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$_vars is deprecated in /usr/local/www/clonos/php/clonos.php on line 62 > [30-Aug-2022 18:19:50 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$config is deprecated in /usr/local/www/clonos/php/clonos.php on line 95 > [30-Aug-2022 18:19:50 UTC] PHP Deprecated: Creation of dynamic property ClonOS::$mode is deprecated in /usr/local/www/clonos/php/clonos.php on line 118 > [30-Aug-2022 18:19:50 UTC] PHP Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/clonos/php/db.php:136 > Stack trace: > #0 /usr/local/www/clonos/public/pages/bhyvevms/a.json.php(7): Db->select() > #1 /usr/local/www/clonos/php/clonos.php(265): include('...') > #2 /usr/local/www/clonos/php/clonos.php(152): ClonOS->ccmd_getJsonPage() > #3 /usr/local/www/clonos/public/json.php(12): ClonOS->__construct() > #4 {main} > thrown in /usr/local/www/clonos/php/db.php on line 136
Author
Owner

@joneum commented on GitHub (Sep 20, 2022):

I have the same error. Is there a solution?

<!-- gh-comment-id:1252757118 --> @joneum commented on GitHub (Sep 20, 2022): I have the same error. Is there a solution?
Author
Owner

@bozhinov commented on GitHub (Sep 20, 2022):

Hello,

Please add this:

private $mode = null;
private $_vars = [];
private $config = null;

after:

private $_user_info=array(
'id'=>0,
'username'=>'guest',
'unregistered'=>true,
);

in /usr/local/www/clonos/php/clonos.php

This is only a problem of PHP 8.2

<!-- gh-comment-id:1252768969 --> @bozhinov commented on GitHub (Sep 20, 2022): Hello, Please add this: private $mode = null; private $_vars = []; private $config = null; after: private $_user_info=array( 'id'=>0, 'username'=>'guest', 'unregistered'=>true, ); in /usr/local/www/clonos/php/clonos.php This is only a problem of PHP 8.2
Author
Owner

@olevole commented on GitHub (Sep 20, 2022):

@moveee FYI ^^

<!-- gh-comment-id:1252944475 --> @olevole commented on GitHub (Sep 20, 2022): @moveee FYI ^^
Author
Owner

@joneum commented on GitHub (Sep 21, 2022):

Hello,

Please add this:

private $mode = null;
private $_vars = [];
private $config = null;

after:

private $_user_info=array( 'id'=>0, 'username'=>'guest', 'unregistered'=>true, );

in /usr/local/www/clonos/php/clonos.php

This is only a problem of PHP 8.2

for me, it doesn't work

<!-- gh-comment-id:1253438674 --> @joneum commented on GitHub (Sep 21, 2022): > Hello, > > Please add this: > > ``` > private $mode = null; > private $_vars = []; > private $config = null; > ``` > > after: > > private $_user_info=array( 'id'=>0, 'username'=>'guest', 'unregistered'=>true, ); > > in /usr/local/www/clonos/php/clonos.php > > This is only a problem of PHP 8.2 for me, it doesn't work
Author
Owner

@G0Dzilla1984 commented on GitHub (Sep 21, 2022):

Hello,
Please add this:

private $mode = null;
private $_vars = [];
private $config = null;

after:
private $_user_info=array( 'id'=>0, 'username'=>'guest', 'unregistered'=>true, );
in /usr/local/www/clonos/php/clonos.php
This is only a problem of PHP 8.2

for me, it doesn't work

In my case it doesn't help too. And then I found clonos.log file in /tmp and saw next:
config.php: vm_profile cache file not found: /usr/jails/tmp/bhyve-vm.json

I made soft link to the right file and all problems are gone (I hope).

<!-- gh-comment-id:1253623102 --> @G0Dzilla1984 commented on GitHub (Sep 21, 2022): > > Hello, > > Please add this: > > ``` > > private $mode = null; > > private $_vars = []; > > private $config = null; > > ``` > > > > > > > > > > > > > > > > > > > > > > > > after: > > private $_user_info=array( 'id'=>0, 'username'=>'guest', 'unregistered'=>true, ); > > in /usr/local/www/clonos/php/clonos.php > > This is only a problem of PHP 8.2 > > for me, it doesn't work In my case it doesn't help too. And then I found clonos.log file in /tmp and saw next: `config.php: vm_profile cache file not found: /usr/jails/tmp/bhyve-vm.json` I made soft link to the right file and all problems are gone (I hope).
Author
Owner

@joneum commented on GitHub (Sep 21, 2022):

Hello,
Please add this:

private $mode = null;
private $_vars = [];
private $config = null;

after:
private $_user_info=array( 'id'=>0, 'username'=>'guest', 'unregistered'=>true, );
in /usr/local/www/clonos/php/clonos.php
This is only a problem of PHP 8.2

for me, it doesn't work

In my case it doesn't help too. And then I found clonos.log file in /tmp and saw next: config.php: vm_profile cache file not found: /usr/jails/tmp/bhyve-vm.json

I made soft link to the right file and all problems are gone (I hope).

if it worked, can you share it?

<!-- gh-comment-id:1253672857 --> @joneum commented on GitHub (Sep 21, 2022): > > > Hello, > > > Please add this: > > > ``` > > > private $mode = null; > > > private $_vars = []; > > > private $config = null; > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > after: > > > private $_user_info=array( 'id'=>0, 'username'=>'guest', 'unregistered'=>true, ); > > > in /usr/local/www/clonos/php/clonos.php > > > This is only a problem of PHP 8.2 > > > > > > for me, it doesn't work > > In my case it doesn't help too. And then I found clonos.log file in /tmp and saw next: `config.php: vm_profile cache file not found: /usr/jails/tmp/bhyve-vm.json` > > I made soft link to the right file and all problems are gone (I hope). if it worked, can you share it?
Author
Owner

@G0Dzilla1984 commented on GitHub (Sep 22, 2022):

My solution is below.
As I said earlier, I found log file in /tmp/clonos.log. In this log file I can see "file not found" error.
I installed and configured cbsd and clonos with non-default prefixes and then I just made symbolic link to the right place for cbsd's "tmp" dir. In my case it was /vm/tmp via this command:
ln -s /vm /usr/jails.
Result you can see here:

root@vbsd:~ # ls -l /usr/
total 152
drwxr-xr-x 2 root wheel 483 May 12 11:32 bin
drwxr-xr-x 3 root wheel 3 Aug 4 09:25 home
drwxr-xr-x 56 root wheel 350 May 12 11:42 include
lrwxr-xr-x 1 root wheel 3 Sep 21 10:19 jails -> /vm
drwxr-xr-x 10 root wheel 751 May 12 11:42 lib
drwxr-xr-x 7 root wheel 748 Aug 4 09:24 lib32
drwxr-xr-x 5 root wheel 5 May 12 11:42 libdata
drwxr-xr-x 10 root wheel 69 May 12 11:32 libexec
drwxr-xr-x 19 root wheel 19 Aug 29 09:57 local
drwxr-xr-x 2 root wheel 2 May 12 11:15 obj
drwxr-xr-x 71 root wheel 84 Aug 29 09:42 ports
drwxr-xr-x 2 root wheel 294 May 12 11:32 sbin
drwxr-xr-x 32 root wheel 32 May 12 11:15 share
drwxr-xr-x 26 root wheel 44 Aug 29 14:12 src
drwxr-xr-x 15 root wheel 15 May 12 11:15 tests

Now I can manipulate vms via web-pane.

<!-- gh-comment-id:1254587415 --> @G0Dzilla1984 commented on GitHub (Sep 22, 2022): > My solution is below. As I said earlier, I found log file in /tmp/clonos.log. In this log file I can see "file not found" error. I installed and configured cbsd and clonos with non-default prefixes and then I just made symbolic link to the right place for cbsd's "tmp" dir. In my case it was /vm/tmp via this command: `ln -s /vm /usr/jails`. Result you can see here: > root@vbsd:~ # ls -l /usr/ > total 152 > drwxr-xr-x 2 root wheel 483 May 12 11:32 bin > drwxr-xr-x 3 root wheel 3 Aug 4 09:25 home > drwxr-xr-x 56 root wheel 350 May 12 11:42 include > lrwxr-xr-x 1 root wheel 3 Sep 21 10:19 jails -> /vm > drwxr-xr-x 10 root wheel 751 May 12 11:42 lib > drwxr-xr-x 7 root wheel 748 Aug 4 09:24 lib32 > drwxr-xr-x 5 root wheel 5 May 12 11:42 libdata > drwxr-xr-x 10 root wheel 69 May 12 11:32 libexec > drwxr-xr-x 19 root wheel 19 Aug 29 09:57 local > drwxr-xr-x 2 root wheel 2 May 12 11:15 obj > drwxr-xr-x 71 root wheel 84 Aug 29 09:42 ports > drwxr-xr-x 2 root wheel 294 May 12 11:32 sbin > drwxr-xr-x 32 root wheel 32 May 12 11:15 share > drwxr-xr-x 26 root wheel 44 Aug 29 14:12 src > drwxr-xr-x 15 root wheel 15 May 12 11:15 tests Now I can manipulate vms via web-pane.
Author
Owner

@joneum commented on GitHub (Oct 11, 2022):

i will test it later - but i had the problem with PHP 8.0 too

Am 20.09.22 um 20:45 schrieb Momchil Bozhinov:

Hello,

Please add this:

|private $mode = null; private $_vars = []; private $config = null; |

after:

private $_user_info=array(
'id'=>0,
'username'=>'guest',
'unregistered'=>true,
);

in /usr/local/www/clonos/php/clonos.php

This is only a problem of PHP 8.2


Reply to this email directly, view it on GitHub
https://github.com/clonos/control-pane/issues/59#issuecomment-1252768969,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABQBHQUYJ5EQNK6Z3JHFOHLV7IA35ANCNFSM57E75WYQ.
You are receiving this because you commented.Message ID:
@.***>

<!-- gh-comment-id:1274243624 --> @joneum commented on GitHub (Oct 11, 2022): i will test it later - but i had the problem with PHP 8.0 too Am 20.09.22 um 20:45 schrieb Momchil Bozhinov: > > Hello, > > Please add this: > > |private $mode = null; private $_vars = []; private $config = null; | > > after: > > private $_user_info=array( > 'id'=>0, > 'username'=>'guest', > 'unregistered'=>true, > ); > > in /usr/local/www/clonos/php/clonos.php > > This is only a problem of PHP 8.2 > > — > Reply to this email directly, view it on GitHub > <https://github.com/clonos/control-pane/issues/59#issuecomment-1252768969>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ABQBHQUYJ5EQNK6Z3JHFOHLV7IA35ANCNFSM57E75WYQ>. > You are receiving this because you commented.Message ID: > ***@***.***> >
Author
Owner

@olevole commented on GitHub (Dec 13, 2022):

Most likely due to the absence of /usr/local/www/clonos/version file. Fixed in clonos ports: github.com/clonos/clonos-ports-wip@7554b2554b

<!-- gh-comment-id:1348035909 --> @olevole commented on GitHub (Dec 13, 2022): Most likely due to the absence of /usr/local/www/clonos/version file. Fixed in clonos ports: https://github.com/clonos/clonos-ports-wip/commit/7554b2554b2204090a781343a91d7fb9ec173f52
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/control-pane#34
No description provided.