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

SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DOCTRINE_2 does not exist when creating short URL using MariaDB/MySQL #2122

Open
cesare190 opened this issue May 10, 2024 · 2 comments
Labels
blocked Issues with some external dependency preventing to work on them bug
Milestone

Comments

@cesare190
Copy link

cesare190 commented May 10, 2024

Shlink version

4.1.0

PHP version

8.3.6

How do you serve Shlink

Docker image

Database engine

MariaDB

Database version

10.11.7

Current behavior

If I try to shorten a long link using the command terminal or the web-app the system returns an error, specifically in the web-app an "unknown error" is shown while the terminal gives some additional information which I report below.

sudo docker exec -it shlink short-url:create

In ExceptionConverter.php line 90:

An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DOCTRINE_2 does not exist

In Exception.php line 28:

SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DOCTRINE_2 does not exist

In Connection.php line 27:

SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DOCTRINE_2 does not exist

I tried to change the version of MariaDB by trying to do downgrades without success. Authentication to the database seems to occur without problems, the redirects assigned to alternative domains to the main one via the respective cli commands and subsequently modifying them via the web-app work correctly. I currently use Nginx Proxy Manager as a reverse proxy.

Expected behavior

Normally I would expect to be able to generate error-free links via the terminal or via the web-app

Minimum steps to reproduce

To create my Shlink environment in Docker you can use this Stack:

version: '3.8'
services:
shlink:
container_name: shlink-web
hostname: shlink-web
image: 'shlinkio/shlink:latest'
restart: unless-stopped
networks:
- webbridge
- default
env_file:
- stack.env

db:
container_name: shlink-db
hostname: shlink-db
image: 'mariadb:lts'
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: ‘rootpassword’
MARIADB_DATABASE: 'shlink'
MARIADB_USER: 'shlink'
MARIADB_PASSWORD: ‘userpassword’
MARIADB_AUTO_UPGRADE: '1'
volumes:
- /var/dockervar/shlink/db:/var/lib/mysql

networks:
default:
driver: bridge
webbridge:
external: true

.env:

DEFAULT_DOMAIN=defaultlink
IS_HTTPS_ENABLED=true
DB_DRIVER=maria
DB_USER=shlink
DB_PASSWORD=userpassword
DB_HOST=shlink-db

Once the two containers have started, it will then be necessary to create an api-key to interact via the web-app. From the terminal this command will return no errors and will work as usual. Instead, creating shortened links should return the error reported above. The way to shorten the links does not change the result but the reason for the error will be returned from the terminal, which does not happen via the web-app.

@cesare190 cesare190 added the bug label May 10, 2024
@acelaya
Copy link
Member

acelaya commented May 10, 2024

Seems to be a bug in Shlink's ORM doctrine/orm#11230. Let's wait for them to fix and I'll release a patch afterwards.

@acelaya acelaya added the blocked Issues with some external dependency preventing to work on them label May 10, 2024
@acelaya acelaya changed the title Dockerized Shlink reports Unknown error when trying to create new short link SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT DOCTRINE_2 does not exist when creating short URL using MariaDB/MySQL May 10, 2024
@acelaya acelaya added this to the 4.1.1 milestone May 10, 2024
@acelaya
Copy link
Member

acelaya commented May 10, 2024

In the meantime, that issue mentions something about disabling "savepoints" (not sure what that is) in MySQL. Maybe that's something you can try.

@acelaya acelaya modified the milestones: 4.1.1, 4.1.2 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Issues with some external dependency preventing to work on them bug
Projects
Status: Todo
Development

No branches or pull requests

2 participants