inrae / sturwild

Record catch of sturgeons in a Postgresql database
MIT License
0 stars 0 forks source link

App doesn't start after install #8

Open problemwolf opened 2 months ago

problemwolf commented 2 months ago

I've tried a clean install .. see install.log

Configured apache and .env as mentioned in Readme. Ppci\Config\IdentificationConfig.identificationMode = BDD

Got Error: [Fri Aug 16 08:45:18.653261 2024] [php:error] [pid 30345:tid 30345] [client $IPADDR:47908] PHP Fatal error: Uncaught Error: Class "Locale" not found in /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/HTTP/IncomingRequest.php:454\nStack trace:\n#0 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/HTTP/IncomingRequest.php(200): CodeIgniter\\HTTP\\IncomingRequest->setLocale()\n#1 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/HTTP/IncomingRequest.php(169): CodeIgniter\\HTTP\\IncomingRequest->detectLocale()\n#2 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Config/Services.php(566): CodeIgniter\\HTTP\\IncomingRequest->__construct()\n#3 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Config/BaseService.php(320): CodeIgniter\\Config\\Services::incomingrequest()\n#4 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Config/Services.php(526): CodeIgniter\\Config\\BaseService::__callStatic()\n#5 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Config/BaseService.php(311): CodeIgniter\\Config\\Services::request()\n#6 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Config/BaseService.php(250): CodeIgniter\\Config\\BaseService::__callStatic()\n#7 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Config/Services.php(522): CodeIgniter\\Config\\BaseService::getSharedInstance()\n#8 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Config/BaseService.php(320): CodeIgniter\\Config\\Services::request()\n#9 /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/Debug/Exceptions.php(129): CodeIgniter\\Config\\BaseService::__callStatic()\n#10 [internal function]: CodeIgniter\\Debug\\Exceptions->exceptionHandler()\n#11 {main}\n thrown in /var/www/sturwildApp/sturwild/vendor/codeigniter4/framework/system/HTTP/IncomingRequest.php on line 454 Got this fixed by installing php-intl apt install php-intl

Got next error, which I can't figure out.

[Fri Aug 16 10:18:59.374577 2024] [php:notice] [pid 32437:tid 32437] [client $IPADDR:59492] CRITICAL --> Ppci\\Libraries\\PpciException: FEHLER: Relation \xc2\xbblog\xc2\xab existiert nicht\nLINE 1: INSERT INTO "log" ("login", "nom_module", "log_date", "ipadd...\n ^\n[Method: GET, Route: /]\nin VENDORPATH/equinton/ppci/src/Models/PpciModel.php on line 211.\n 1 VENDORPATH/equinton/ppci/src/Models/PpciModel.php(263): Ppci\\Models\\PpciModel->write()\n 2 VENDORPATH/equinton/ppci/src/Models/Log.php(87): Ppci\\Models\\PpciModel->ecrire()\n 3 VENDORPATH/equinton/ppci/src/Helpers/ppci_helper.php(88): Ppci\\Models\\Log->setLog()\n 4 VENDORPATH/equinton/ppci/src/Filters/StartcallFilter.php(30): setLogRequest()\n 5 SYSTEMPATH/Filters/Filters.php(203): Ppci\\Filters\\StartcallFilter->before()\n 6 SYSTEMPATH/Filters/Filters.php(184): CodeIgniter\\Filters\\Filters->runBefore()\n 7 SYSTEMPATH/CodeIgniter.php(481): CodeIgniter\\Filters\\Filters->run()\n 8 SYSTEMPATH/CodeIgniter.php(355): CodeIgniter\\CodeIgniter->handleRequest()\n 9 SYSTEMPATH/Boot.php(325): CodeIgniter\\CodeIgniter->run()\n10 SYSTEMPATH/Boot.php(67): CodeIgniter\\Boot::runCodeIgniter()\n11 FCPATH/index.php(58): CodeIgniter\\Boot::bootWeb()\n

Database seems setup correctly, see catalog.txt

problemwolf commented 2 months ago

Changed database.default.searchpath = sturwild,gacl,public to database.default.searchpath = sturwild,sturwildgacl,public to get this fixed.

equinton commented 2 weeks ago

Sorry for the delay, I hadn't seen the tickets before (probably send during my holidays).

I've prepared a new release and I've test the deployment on a new machine. It run correctly now.

To fix the error into this ticket, you must run these commands:

apt-get install php8.3-intl
systemctl restart apache2

The database has an error, too (not really a big problem). To fix it:

su postgres
psql sturwild
select * from sturwild.dbparam;
drop table sturwild.dbparam;
CREATE TABLE sturwild.dbparam (
    dbparam_id integer NOT NULL DEFAULT nextval('sturwild.dbparam_dbparam_id_seq'::regclass),
    dbparam_name character varying NOT NULL,
    dbparam_value character varying,
    dbparam_description varchar NULL,
    dbparam_description_en varchar NULL,
    CONSTRAINT dbparam_pk PRIMARY KEY (dbparam_id)
);
COMMENT ON TABLE sturwild.dbparam IS E'Table of parameters intrinsically associated to the instance';
COMMENT ON COLUMN sturwild.dbparam.dbparam_name IS E'Name of the parameter';
COMMENT ON COLUMN sturwild.dbparam.dbparam_value IS E'Value of the parameter';
COMMENT ON COLUMN sturwild.dbparam.dbparam_description IS 'Description of the parameter';
COMMENT ON COLUMN sturwild.dbparam.dbparam_description_en IS 'Description of the parameter, in English';
ALTER TABLE sturwild.dbparam OWNER TO sturwild;
create unique index if not exists dbparamname_idx on sturwild.dbparam (dbparam_name);
INSERT INTO sturwild.dbparam (dbparam_name,dbparam_value,dbparam_description,dbparam_description_en) VALUES
     ('APPLI_code','Institute','Code de l''institut. Ce code est utilisé pour les échanges d''informations','Code of the institute. This code is used to exchange data'),
     ('APPLI_title','STURWILD','Nom de l''instance, affiché dans l''interface','Instance name, displayed in the interface'),
     ('mapDefaultX','-0.70','Longitude de positionnement par défaut des cartes','Default positioning longitude for maps'),
     ('mapDefaultY','44.77','Latitude de positionnement par défaut des cartes','Default positioning latitude for maps'),
     ('mapDefaultZoom','7','Niveau de zoom par défaut dans les cartes','Default zoom level in maps'),
     ('otp_issuer','sturwild.mysociety.com','Nom affiché dans les applications de génération de codes uniques pour l''identification à double facteur','Name displayed in applications generating unique codes for two-factor identification');

The command select * from sturwild.dbparam has displayed the content of the table: you can now rewrite your local information.

And, to update the software:

cd /var/www/sturwildApp/sturwild
git pull origin main