Change Previews Folder to SSD

Hi,

NC version: NC Hub 29.0.0
OS: Debian 12
NC image: linuxserver docker container

I am having an issue with trying to get my nextcloud preview folder to be on my recently installed SSD. Up to now, everything works great, I have carried out all of the various tuning steps and my server is snappy.

I couldnt help myself but want to speed preview loading a little more by introducing an NVME ssd into my system and updating my container to bind to it:

volumes:
      - /srv/dev-disk-by-uuid-c3060981-d75c-4ea9-8285-2333c24522df/nextcloud:/config
      - /srv/dev-disk-by-uuid-c3060981-d75c-4ea9-8285-2333c24522df/nextcloud-data:/data
      - /srv/dev-disk-by-uuid-98804e17-cc15-4de0-bd6d-db601baa8792/ncpreviews:/data/appdata_ocrue0s1tf5r/preview
      - /etc/localtime:/etc/localtime:ro

Following this I deleted my old previews folder on my HDD and redeployed the stack.

Upon redeployment I ran:

occ files:scan-app-data and receive the following errors

In ExceptionConverter.php line 42:

  [Doctrine\DBAL\Exception\LockWaitTimeoutException (1205)]
  An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction


In Exception.php line 28:

  [Doctrine\DBAL\Driver\PDO\Exception (1205)]
  SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction


In Statement.php line 130:

  [PDOException (HY000)]
  SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

When I try to run occ preview:generate-all I get the following:

2024-05-13T17:57:15+00:00 In File.php line 56:
2024-05-13T17:57:15+00:00 In File.php line 56:
2024-05-13T17:57:15+00:00   [OCP\Files\GenericFileException]
2024-05-13T17:57:15+00:00 In File.php line 56:
2024-05-13T17:57:15+00:00   [OCP\Files\GenericFileException]
2024-05-13T17:57:15+00:00 In File.php line 56:
2024-05-13T17:57:15+00:00   [OCP\Files\GenericFileException]

I’m really not sure where to go with this one, my nextcloud logs are now packed with errors:

I consider myself humbled!

Please let me know if you have any advice on this one, its driving me mad!

Thanks for your time.

Rowan

Update:

I believe I fixed the issue:

  1. Disable and Uninstall memories, recognize and previewgenerate

  2. delete contents of folder /data/appdata_[XXXXXX]/preview/

rm  /data/appdata_[xxxxx]/preview/* 

  1. shell into your nextclouddb container:
docker exec -it nextclouddb /bin/bash
  1. enter mySQL
mysql --user=oc_yourusername --password dbname

and enter mariadb password when prompted.

  1. In MySQL remove file locks and remove incorrect preview table entries
DELETE FROM oc_file_locks WHERE oc_file_locks.lock != 0;

DELETE FROM oc_filecache WHERE path LIKE "appdata_[xxxxxxx]/preview/%";

  1. Hopefully at this point there are no open tables in use:
MariaDB [nextcloud]>  show open tables where in_use>0;
Empty set (0.001 sec)

  1. Go ahead and restart your containers, reinstall memories, index files (in parallel with 4 threads)
bash -c 'for i in {1..4}; do (occ memories:index &); done' 

  1. install preview generator and scan app data after configuring how you wish, then preview generate for all files
occ files:scan-app-data
occ preview:generate-all 

(buckle-up, this can take a while)

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.