Error Generating Database When Trying To Setup Shlink #1849
-
How Shlink is set up
SummaryAs described above, I tried installing shlink via docker (from the install docker page: https://shlink.io/documentation/install-docker-image/ ). I was able to successfully generate an API key. All the commands worked well until I got to the step titled "use an external db" As you can see I pasted the command below: Regardless if I chose to run it with mysql or mariadb - online or locally - I still got the error:
docker run
I had to delete the docker container with the name my_shlink because when I was running the next command:
It gave me the error:
So I just decided to delete that container and move on to the next command For context, all I'm trying to do is to find a free or cheap way to create QR codes with links (I don't care about custom domain names) and then I want to use a rest API to change the original URL that that QR code would link to without changing the shlink URL. If there is another way to do this (with another tool - preferably with CORS) or a simpler way to go through the installation, please do let me know! THANK YOU! Current behaviorI'm getting the error: Expected behaviorI should not be getting the above error but should be able to proceed to hosting the docker image or whatever the local installation file builds (does the local dist installation file also create a docker image)? How to reproduceYou can try going through the same installation steps I went through on a Windows 11 machine - where I installed Ubuntu 22.04 lts and Docker and just ran the above commands |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
PHP 8.1.2 has a bug. Other people have reported issues running Shlink with that version and the only solution is to update to a newer one. See #1722 That said, the docker image is using a different PHP version, so you should not get affected by that. Try passing |
Beta Was this translation helpful? Give feedback.
-
Ok great, thank you so much! I ended up passing -e SHELL_VERBOSITY=3 to the docker image I wanted to build and I found out that I had the error because my azure MySQL database required an SSL certificate so I removed the need for that online and it worked. This is the command I ran However, whenever I visit localhost:8081, I get an error message saying 404 page not found. Am I missing something here, I just want to access the web client after running the docker image (also the error on my dist installation tool is still giving me the same error in database creation but I'm not going to use that tool). I thought I would be able to access the web client locally on localhost:8080 or 8081 but apparently that doesn't work I can try using the web client that is freely hosted by shlink: https://app.shlink.io/server/create but I believe I would need to host my docker image to a server, correct? Otherwise, what would I put as the URL? Essentially, all I would like to do is to create a REST API that changes the URL destination of QR codes I generate. Unfortunately, to me the documentation is a bit unclear as to how I can get the REST API running. What are my next steps? I'm confused do I need to serve the docker image to access the rest API and to serve the docker image, do I need to do something with road runner (which would confuse me even more because running the docker image creates a roadrunner server anyways). Again, your help would be greatly appreciated! P.S. this is the output I get when I run the docker image and it successful:
The last part is what I get when I load the localhost:8080 or localhost:8081 which shows that it was "processed successfully" even though the web page is giving me a 404 error:
|
Beta Was this translation helpful? Give feedback.
-
Getting a 404 on the base path is expected. You can alternatively configure a redirect, but the 404 is the default behavior. Shlink does not include a UI. You can either interact with it with the CLI, use the official web client (https://app.shlink.io or self-hosted) or use any other unofficial client. |
Beta Was this translation helpful? Give feedback.
PHP 8.1.2 has a bug. Other people have reported issues running Shlink with that version and the only solution is to update to a newer one. See #1722
That said, the docker image is using a different PHP version, so you should not get affected by that.
Try passing
SHELL_VERBOSITY=3
to the docker container. It's equivalent to-vvv
for when you are not the one running the command https://shlink.io/documentation/troubleshooting/#troubleshoot-errors-when-booting-up-the-docker-image