clonos / control-pane

ClonOS WEB control panel (CBSD WEB UI)
https://clonos.tekroutine.com
128 stars 31 forks source link

500 Internal Server Error #59

Open krlex opened 1 year ago

krlex commented 1 year ago

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

G0Dzilla1984 commented 1 year ago

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/"`

bozhinov commented 1 year ago

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

olevole commented 1 year ago

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 )

G0Dzilla1984 commented 1 year ago

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

joneum commented 1 year ago

I have the same error. Is there a solution?

bozhinov commented 1 year ago

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

olevole commented 1 year ago

@moveee FYI ^^

joneum commented 1 year ago

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

G0Dzilla1984 commented 1 year ago

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).

joneum commented 1 year ago

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?

G0Dzilla1984 commented 1 year ago

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.

joneum commented 1 year ago

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: @.***>

olevole commented 1 year ago

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