September 21, 2025Sep 21 Same Error: https://forums.unraid.net/topic/186646-unraid-web-gui-inaccessible-with-error-500/syslogSep 22 07:56:39 NAS nginx: 2025/09/22 07:56:39 [error] 4739#4739: *88870 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.0.3, server: , request: "GET /Main HTTP/1.1", subrequest: "/auth-request.php", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "192.168.0.2" Sep 22 07:56:39 NAS nginx: 2025/09/22 07:56:39 [error] 4739#4739: *88870 auth request unexpected status: 404 while sending to client, client: 192.168.0.3, server: , request: "GET /Main HTTP/1.1", host: "192.168.0.2" Sep 22 07:56:39 NAS nginx: 2025/09/22 07:56:39 [error] 4739#4739: *88872 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.0.3, server: , request: "GET /favicon.ico HTTP/1.1", subrequest: "/auth-request.php", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "192.168.0.2", referrer: "http://192.168.0.2/Main" Sep 22 07:56:39 NAS nginx: 2025/09/22 07:56:39 [error] 4739#4739: *88872 auth request unexpected status: 404 while sending to client, client: 192.168.0.3, server: , request: "GET /favicon.ico HTTP/1.1", host: "192.168.0.2", referrer: "http://192.168.0.2/Main"I found why this error occurred,origin /usr/local/emhttp/root@NAS:/usr/local/emhttp# ls -alh total 37K drwxr-xr-x 1 root root 80 Jun 22 09:17 ./ drwxr-xr-x 1 root root 60 Jun 22 09:17 ../ -rw-r--r-- 1 root root 1.6K Nov 16 2023 auth-request.php lrwxrwxrwx 1 root root 5 Nov 16 2023 boot -> /boot/ -rw-r--r-- 1 root root 15K Nov 16 2023 favicon.ico drwxr-xr-x 1 root root 60 Nov 16 2023 languages/ lrwxrwxrwx 1 root root 8 Nov 16 2023 log -> /var/log/ -rw-r--r-- 1 root root 6.6K Nov 16 2023 logging.htm -rw-r--r-- 1 root root 1.5K Feb 3 2024 login.php lrwxrwxrwx 1 root root 4 Nov 16 2023 mnt -> /mnt/ drwxr-xr-x 1 root root 120 Jun 22 09:17 plugins/ -rw-r--r-- 1 root root 1.7K Jan 23 2025 redirect.htm -rw-r--r-- 1 root root 26 Nov 16 2023 robots.txt lrwxrwxrwx 1 root root 17 Nov 16 2023 state -> /var/local/emhttp/ -rw-r--r-- 1 root root 3.0K Nov 16 2023 update.htm -rw-r--r-- 1 root root 5.9K Aug 28 2024 update.php lrwxrwxrwx 1 root root 15 Nov 16 2023 webGui -> plugins/dynamix/error thenroot@NAS:/usr/local/emhttp# ls -alh total 0 drwxr-xr-x 1 root root 320 Sep 22 04:30 ./ drwxr-xr-x 1 root root 60 Jun 22 09:17 ../ drwxr-xr-x 1 root root 60 Nov 16 2023 languages/ drwxr-xr-x 1 root root 140 Jun 22 09:17 plugins/ lrwxrwxrwx 1 root root 15 Nov 16 2023 webGui -> plugins/dynamix/I do not know why some files removed.. Edited September 22, 2025Sep 22 by KDY
September 22, 2025Sep 22 Author Solution I found why this error occurred,This happened entirely because of my mistake.I use a plugin called user.script.It's a simple file-moving script like the one below.#!/bin/bash shopt -s nullglob SRC="/mnt/cache/recorders" DST="/mnt/user/backup/recorders" for cam in cam1 cam2 cam3 cam4; do files=( $(ls -1 "$SRC"/${cam}_*.mp4 2>/dev/null | sort) ) count=${#files[@]} if (( count > 1 )); then for ((i=0; i<count-1; i++)); do f="${files[$i]}" mv "$f" "$DST/" done fi doneAt first glance, it doesn’t seem problematic, but if the SRC directory doesn’t actually exist, this becomes a serious issue.I think the ls command is pointing to /usr/local/emhttp/ and moving those files to DST.This wasn’t a problem with user.script or unraid, it was my fault for writing dumb code.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.