LinkStack 500 Server Error when adding links: what to check
LinkStack returns a 500 Server Error when you add a link or click a /going/ID link. Check logs, disk, permissions and Docker volumes, and what's unconfirmed.
The Liite team8 Min. Lesezeit
Short answer
A 500 only says the server failed, so read the error log first: reproduce the error, then run docker logs <container-name> (or open the app's logs in YunoHost). Then rule out a full disk, unwritable folders or database file, and a Docker volume that isn't mounted where the app expects it. Back up your data folder before you change anything.
Your self-hosted LinkStack was fine, and now saving a new link fails with a 500 Server Error. Clicking a link that goes through /going/ID fails the same way. People report this on the YunoHost forum and in a discussion on the LinkStack Docker repository. Neither thread shows a confirmed fix, and a GitHub issue about it has reportedly been open since January. This article covers what a 500 can mean here and how to narrow it down. It also says plainly where we are guessing.
Why LinkStack returns a 500 when you add or click a link
A 500 is a generic server-side failure. The server received your request, the application threw an error, and the web server returned a 500 without saying why. The reason is in a log, not in the browser.
The reports describe two symptoms:
- Saving a new link fails.
- Opening a
/going/IDlink fails.
The Docker discussion has around 20 comments and showed no accepted answer when the report was collected. The YunoHost thread describes the same adding-links error. Neither thread establishes a root cause, so we can't tell you which one you have.
LinkStack is a PHP application backed by a database, and adding a link has to write to that database. That much is general knowledge. Whether the two symptoms share a cause is speculation on our part. One possibility is that a click on a /going/ID link also records something, which would make it a write too. The threads don't confirm this, and the two failures could just as well have separate causes. Check your own log before assuming either.
The usual suspects for a PHP app that reads fine but fails on writes:
- The database file or database server can't be written to.
- The app's storage or cache folders aren't writable by the web server user.
- A container was recreated and the data volume isn't mounted where the app expects it.
- The disk is full.
- An update changed the app or its database structure and your existing data no longer matches.
These are general explanations, not confirmed causes for your install.
Step-by-step: find what is failing
1. Read the real error
- Reproduce the failure: add a link, or open a
/going/IDlink. - Immediately look at the logs. With Docker, run
docker logs <container-name>. - On YunoHost, open the app's logs from the admin panel, or use the command line on the server.
- Find the line just before the 500. It usually names a file, folder, table or query.
Many PHP frameworks also keep their own application log inside the app's storage folder. If the web server log is blank, look there too. Check the project's documentation for the exact path on your version rather than guessing.
2. Check free disk space
On the host, run:
df -hIf the partition holding your Docker data or the app is at 100%, writes fail while pages still load. That matches "everything works except saving."
3. Check permissions
If the log mentions a write failure, check three things:
- The database file and the folders the app writes to belong to the user the web server runs as.
- They are not on a read-only mount.
- A recent restore or file copy didn't change their ownership to root.
A restore done as root is a common way to end up with a database the web server can read but not write.
4. Check your volumes (Docker)
Run:
docker inspect <container-name>Look at the mounts section. Confirm your data volume or bind mount is attached to the running container, at the path the image documents for persistent data. If the container was recreated without the volume, the app may be running against an empty or mismatched data folder, which can produce errors on write.
5. Back up before you change anything
Copy the data volume or folder first. The threads describe no restore procedure, so your own copy is the only safety net. A copy takes a minute. A lost database file does not come back.
6. Check whether you just updated
If the errors began right after an image or package update, test by rolling back to the previous image. Do this only with a backup in hand, because a newer version may already have changed your data.
7. Look for newer reports
Search the project's issue tracker and discussions for your exact log line. The problem may have been fixed since these threads were written, and the maintainers' pages are where that would show up.
Back up first
Do not delete the container, remove the volume or reinstall until you have copied the data folder. A reinstall can hide the cause and destroy the only copy of your links.
Cause, symptom and fix at a glance
| Likely cause | What you'd see | What to try |
|---|---|---|
| Disk full | Pages load, saving fails | df -h, free space, retry |
| Wrong file ownership | Log mentions a write or permission failure | Give the web server user write access to the database and storage folders |
| Read-only mount | Writes fail after a host or container change | Check the mount options in docker inspect |
| Volume not attached | Links missing or odd errors after a recreate | Reattach the original volume, then restart |
| Update mismatch | Errors start right after an upgrade | Roll back the image, with a backup |
| Something else | Log line points elsewhere | Post the exact line in the issue thread |
What won't help
- Clearing your browser cache or switching browsers. The failure is on the server.
- Re-adding the same link over and over. If writes fail, retrying changes nothing and may leave partial entries.
- Reinstalling blindly. Without the log line you won't know whether you fixed the cause or just hid it.
Checklist before you try again
- You have read the log line just before the 500.
- The disk has free space.
- The database file and storage folders are writable by the web server user.
- The data volume is mounted in the running container.
- You have a copy of the data folder stored somewhere else.
- You know whether the problem started after an update.
If nothing works
Ask where the reports already live: the LinkStack Docker discussion on GitHub, or the YunoHost forum thread if you installed through YunoHost. Include the exact log line, your LinkStack version, how you run it (Docker or YunoHost), when it started and what you have already tried. A log line gets answers faster than "I get a 500." You can start from this:
Subject: 500 error when adding a link / opening /going/ID
Setup: LinkStack <version>, running on <Docker image tag / YunoHost version>
Problem: Saving a new link returns "500 Server Error". Opening a /going/ID link also returns 500.
Started: <date/time>, after <update / restore / container recreate / nothing I changed>
Log line before the 500: <paste exact line>
Disk space: <output of df -h for the data partition>
Volume/mount: <relevant part of docker inspect>
Already tried: checked permissions, checked disk space, <rollback?>Common questions
Is this a bug in LinkStack?
We don't know. The reports show the symptom, and we saw no diagnosis from the maintainers in the threads. Your own log is the only thing that can say whether it's your setup or the software.
Will my existing links survive?
Only if your data folder or volume is intact, which is why the backup comes before any rollback or reinstall. Check that your data folder is where you expect before you assume anything is lost.
Do Docker and YunoHost fail the same way?
Reports exist for both, and the symptoms match. That does not prove a shared cause. Both run the same application, but the file ownership and mounts differ.
Can I move my links out while this is broken?
If your admin panel still loads and shows your links, copy them somewhere safe by hand. If the database is unreadable, restore your backup copy elsewhere to read them.
If you only need a link page and don't want to run a server
This won't fix your LinkStack install. If all you need is a link-in-bio page, Liite hosts one for you, so there is no server, database or volume of your own to maintain. A Free Pages site needs no card and gives you one site with 15 blocks per page. Our guide to making a link-in-bio page in five minutes walks through it. Liite has no LinkStack importer. Its Import tool does accept any website URL, so you can try it on your page, and add whatever doesn't come across by hand.