Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Internal Server Error #59

Open
krlex opened this issue Aug 21, 2022 · 13 comments
Open

500 Internal Server Error #59

krlex opened this issue Aug 21, 2022 · 13 comments
Assignees

Comments

@krlex
Copy link

krlex commented Aug 21, 2022

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
Copy link

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
Copy link
Contributor

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

@olevole
Copy link
Member

olevole commented 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 )

@G0Dzilla1984
Copy link

G0Dzilla1984 commented 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

@joneum
Copy link

joneum commented Sep 20, 2022

I have the same error. Is there a solution?

@bozhinov
Copy link
Contributor

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
Copy link
Member

olevole commented Sep 20, 2022

@moveee FYI ^^

@joneum
Copy link

joneum commented 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

@G0Dzilla1984
Copy link

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
Copy link

joneum commented 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?

@G0Dzilla1984
Copy link

G0Dzilla1984 commented 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.

@joneum
Copy link

joneum commented Oct 11, 2022 via email

@olevole olevole self-assigned this Dec 10, 2022
@olevole
Copy link
Member

olevole commented Dec 13, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants