nuber-io / nuber

Virtualization management software
https://www.nuber.io
GNU Affero General Public License v3.0
29 stars 5 forks source link

500 after adding my first server #26

Closed vosdev closed 2 years ago

vosdev commented 2 years ago

image

root@nuber:/var/www/logs# tail -f application.log
[2022-05-06 16:25:50] application CRITICAL: TypeError Argument 2 passed to __() must be of the type array, int given, called in /var/www/app/Model/Host.php on line 130 in vendor/originphp/framework/src/I18n/functions.php:26
[2022-05-06 16:25:56] application CRITICAL: TypeError Argument 2 passed to __() must be of the type array, int given, called in /var/www/app/Model/Host.php on line 130 in vendor/originphp/framework/src/I18n/functions.php:26
[2022-05-06 16:26:01] application CRITICAL: TypeError Return value of App\Http\Controller\ApplicationController::getDefaultHost() must be of the type string, null returned in app/Http/Controller/ApplicationController.php:95
[2022-05-06 16:26:13] application CRITICAL: TypeError Return value of App\Http\Controller\ApplicationController::getDefaultHost() must be of the type string, null returned in app/Http/Controller/ApplicationController.php:95

The last two lines pop up when I visit the nuber webpage /instances. The first two popped up after configuring my first server

Last line in lxd.log shows a 404 not found:

{"date":"2022-05-06 16:25:56","channel":"lxd","level":"ERROR","message":"POST /1.0/certificates","host":"192.168.178.5","method":"POST","requestURL":"https://192.168.178.5:8443/1.0/certificates","requestBody":{"type":"client","name":"nuber","password":"QUyLH9RueF2k"},"responseHeaders":{"HTTP/2 404 ":null,"content-type":"application/json","x-content-type-options":"nosniff","content-length":"114","date":"Fri, 06 May 2022 16"},"responseCode":404,"responseBody":{"type":"error","status":"","status_code":0,"operation":"","error_code":404,"error":"not found","metadata":null}}

Server runs LXD 5.1

jamielsharief commented 2 years ago

I am guessing this is all happening because something when wrong when configuring it (as seen in other github issue). You can resetting the installation which gets rid of the saved settings. I cant test now but.

deleting the database file, data/nuber.db bin/console db:setup delete this file config/install.json then go back to the url/install

jamielsharief commented 2 years ago

Basically its having trouble finding the default host. Its friday night, i will try to look at it over the weekend. You can try reinstalling, and setting up if instructions dont work above.

vosdev commented 2 years ago

Trying to add my server to a local lxd instance as a remote server throws me the same "Error not found" so I will get to debugging that.

Thanks for instructions on resetting my Nuber application, maybe put it in the docs? I couldn't find it there.

https://github.com/lxc/lxd/issues/10376

vosdev commented 2 years ago

Okay so I executed your instructions. Removed data/nuber.db, ran bin/console db:setup, rm config/install.json and went to my /install. Filled in my information and the sql database is readonly

[2022-05-07 9:59:01] application DEBUG: BEGIN EXCLUSIVE TRANSACTION
[2022-05-07 9:59:01] application ERROR: DatasourceException SQLSTATE[HY000]: General error: 8 attempt to write a readonly database vendor/originphp/framework/src/Model/Connection.php:282

No rush.LXD did a rewrite on the whole certificate/trust area so I'll likely have to wait for LXD 5.2 before I can start to use Nuber

jamielsharief commented 2 years ago

Ahh you need to chown www-data:www-data data/nuber.db.

jamielsharief commented 2 years ago

The resetting db is only something in rare circumstance to do, in this case because your installation failed. Normally this would mean data loss, so that is why its not there.

jamielsharief commented 2 years ago

I have pushed an update that fixes the error caused by trying to render an error, it does not fix the problem that you are having.

https://www.nuber.io/docs/nuber/updates/

jamielsharief commented 2 years ago

The chown needs to be run after the dB setup command as if not it's owned by root , sorry for not making that clear earlier.

vosdev commented 2 years ago

Ah yes that belongs to www-data. I chowned the db file and now I was able to create my user. I'll still have to wait for a fix on the 404 that LXD now returns on the /1.0/certificates path but after that I'll start using Nuber right away!

Thanks for the assistance with that.