Unknown MySQL server host issue with solvable_files.sh script

Hey Everyone,

I recently inherited responsibility for a NC 24.0.4 instance (running on snap) when our entire DevOPS team left the company. Quite frankly, I haven’t done any Linux sysadmin work in over a decade, so to say that I am rusty would be a significant understatement.

We are having the invalid modification time error with the Windows desktop client, so I am trying to run the solvable_files.sh script to fix the issue, albeit without success. I was able to find most of the information I needed from the NC config.php, but I cannot get it to find the database host properly.

I verified that we are running MySQL, and that the mysql.sock file is in the /tmp/snap.nextcloud/tmp/sockets folder, but when I run the script I get the following error:
ERROR 2005 (HY000): Unknown MySQL server host ‘localhost:/tmp/snap.nextcloud/tmp/sockets/mysql.sock’

I am running the following:
./solvable_files.sh /var/snap/nextcloud/common/nextcloud/data mysql localhost:/tmp/snap.nextcloud/tmp/sockets/mysql.sock nextcloud ###### nextcloud list scan

I’ve tried multiple variations of the command (e.g., localhost:/tmp/sockets/mysql.sock), and using 127.0.0.1 instead of localhost. I have zero experience with snap, so I’m guessing I’m missing something there, but I really have no idea what.

Any assistance you could provide would be greatly appreciated!

Can you share the source of this script? I can already point to a problem with your command, but even if you fix it I’m not sure it will work without looking at it.

The script I’m using came from here:

Thank you!

@kyrofa just realized I didn’t tag you in my reply. Any chance you might have an idea on this?

Thanks!

@gmarques - I have the same issue. I suspect that solvable_files.sh doesn’t support snap installations, but I’m out of my depth trying to modify it to do so. With snap you need to use nextcloud.mysql-client to access the database.
In my case I have broken mdates on both client and server files. Updating the client files’ mdate didn’t fix the problem (although I do now get green ticks), nor did updating the server files’ mdate.

Yes it’s true, it appears that this script only supports non-snap installations I’m afraid.

Changing the server file mtime worked after all - it just took some time for it to sort itself out. I used the script at https://help.nextcloud.com/t/client-desktop-mac-change-date-to-01-01-1970-after-download/129765/9?u=3mu, but had to modify the IFS line:

#!/bin/sh

OIFS=“$IFS”
IFS=$’

FILES=$( find . -type f ! -newermt “1971-01-01” )

for FILE in $FILES; do

NEWTIME=$( stat -c %z "$FILE" )
echo "Setting '$FILE' to '$NEWTIME'"
# touch -m --date="$NEWTIME" "$FILE" # Comment to test

done

then run

sudo nextcloud.occ files:scan --all