Note: No shlink
application tag is available on this forum, though it’s packaged and available.
In setting up shlink and performing manual administration steps, here’s a brief guide to errors I’ve encountered, and corrections or improvements.
Parse error / T_OBJECT_OPERATOR / `->` -> invoked with wrong php major version
root@yuno:/var/www/shlink# sudo $(cat .env) -u shlink php7.4 bin/cli api-key:generate --name first-key
PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ')' in /var/www/shlink/config/container.php on line 27
The rest of this command comes from later tricks, the key difference here is php7.4
instead of required php8.[x]
no driver exception -> set the env
Set the env: /var/www/shlink $ sudo $(cat .env) -u shlink php8.2 bin/cli [list|api-key:generate]
api-key:generate ... relation ____ does not exist exception -> ?
root@yuno:/var/www/shlink# sudo $(cat .env) -u shlink php8.2 bin/cli api-key:generate --name first-key
In ExceptionConverter.php line 71:
An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "api_keys" does not exist
LINE 1: INSERT INTO api_keys ("key", "name", expiration_date, enable...
^
In Exception.php line 28:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "api_keys" does not exist
LINE 1: INSERT INTO api_keys ("key", "name", expiration_date, enable...
^
In Statement.php line 130:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "api_keys" does not exist
LINE 1: INSERT INTO api_keys ("key", "name", expiration_date, enable...
^
api-key:generate [-m|--name NAME] [-e|--expiration-date EXPIRATION-DATE] [-a|--author-only] [-d|--domain-only DOMAIN-ONLY] [-o|--no-orphan-visits]
Currently working on this. bin/doctrine
has orm:generate-entities
command, but has not solved my problem yet. Might try a reinstall, manually (beware) or by yunohost.
progression
/var/www/shlink $ bin/cli api-key:generate
/var/www/shlink $ sudo -u shlink bin/cli api-key:generate
/var/www/shlink $ sudo -u shlink php8.2 bin/cli api-key:generate
or ... bin/doctrine [list]
/var/www/shlink $ sudo $(cat .env) -u shlink php8.2 bin/cli api-key:generate
Other inquiries
My YunoHost server
Hardware: own server, in lxc container
YunoHost version: 11.2.10.3 (stable) (upgraded during this, no difference in errors)
I have access to my server : through ssh & webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain: N.A.
If your request is related to an app, specify its name and version: shlink 3.7.3~ynh1