Generate-all error over SMB

Hi,

I’m giving preview generator a first try and I get an error partway through the process (stacktrace below).

In my setup, my pictures are all on a samba share added as external storage to nextcloud.

I’m fairly new to Nextcloud, a home user, and self hosted. Would someone have any suggestion on how to get more information to help diagnose this issue?

Thanks!

...
2022-03-16T21:27:37+00:00 Generating previews for /Pictures/cats/P1000031.JPG
2022-03-16T21:27:37+00:00 Generating previews for /Pictures/cats/P1000034.JPG
2022-03-16T21:27:37+00:00 Generating previews for /Pictures/cats/P1000035.JPG
2022-03-16T21:27:37+00:00 
2022-03-16T21:27:37+00:00 In Parser.php line 157:
2022-03-16T21:27:37+00:00                                         
2022-03-16T21:27:37+00:00   [Icewind\SMB\Exception\Exception]     
2022-03-16T21:27:37+00:00   Malformed state response from server  
2022-03-16T21:27:37+00:00                                         
2022-03-16T21:27:37+00:00 
2022-03-16T21:27:37+00:00 Exception trace:
2022-03-16T21:27:37+00:00   at /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php:157
2022-03-16T21:27:37+00:00  Icewind\SMB\Wrapped\Parser->parseStat() at /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php:217
2022-03-16T21:27:37+00:00  Icewind\SMB\Wrapped\Share->stat() at /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php:189
2022-03-16T21:27:37+00:00  OCA\Files_External\Lib\Storage\SMB->getFileInfo() at /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php:653
2022-03-16T21:27:37+00:00  OCA\Files_External\Lib\Storage\SMB->file_exists() at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php:227
2022-03-16T21:27:37+00:00  OC\Files\Storage\Wrapper\Wrapper->file_exists() at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php:227
2022-03-16T21:27:37+00:00  OC\Files\Storage\Wrapper\Wrapper->file_exists() at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php:244
2022-03-16T21:27:37+00:00  OC\Files\Storage\Wrapper\Availability->file_exists() at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php:227
2022-03-16T21:27:37+00:00  OC\Files\Storage\Wrapper\Wrapper->file_exists() at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php:227
2022-03-16T21:27:37+00:00  OC\Files\Storage\Wrapper\Wrapper->file_exists() at /var/www/nextcloud/lib/private/Files/View.php:1344
2022-03-16T21:27:37+00:00  OC\Files\View->getCacheEntry() at /var/www/nextcloud/lib/private/Files/View.php:1393
2022-03-16T21:27:37+00:00  OC\Files\View->getFileInfo() at /var/www/nextcloud/lib/private/Files/Node/Root.php:200
2022-03-16T21:27:37+00:00  OC\Files\Node\Root->get() at /var/www/nextcloud/lib/private/Files/Node/Folder.php:146
2022-03-16T21:27:37+00:00  OC\Files\Node\Folder->get() at /var/www/nextcloud/lib/private/Files/Node/Folder.php:155
2022-03-16T21:27:37+00:00  OC\Files\Node\Folder->nodeExists() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:201
2022-03-16T21:27:37+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:212
2022-03-16T21:27:37+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:212
2022-03-16T21:27:37+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:192
2022-03-16T21:27:37+00:00  OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:138
2022-03-16T21:27:37+00:00  OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() at /var/www/nextcloud/lib/private/User/Manager.php:645
2022-03-16T21:27:37+00:00  OC\User\Manager->callForSeenUsers() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:139
2022-03-16T21:27:37+00:00  OCA\PreviewGenerator\Command\Generate->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:255
2022-03-16T21:27:37+00:00  Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1009
2022-03-16T21:27:37+00:00  Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:273
2022-03-16T21:27:37+00:00  Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:149
2022-03-16T21:27:37+00:00  Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:209
2022-03-16T21:27:37+00:00  OC\Console\Application->run() at /var/www/nextcloud/console.php:99
2022-03-16T21:27:37+00:00  require_once() at /var/www/nextcloud/occ:11
2022-03-16T21:27:37+00:00 
2022-03-16T21:27:37+00:00 preview:generate-all [-p|--path [PATH]] [--] [<user_id>...]
2022-03-16T21:27:37+00:00

Hi,

wanted to tell you that a search spat out your thread, and I have the exactly same issue, and also the same configuration: photos are on the samba share added as external storage to nextcloud.

PG starts to generate previews with command sudo -u www-data php /var/www/html/occ preview:generate-all -vvv but then stops at a certain point.

Were you ever able to sort it out?

Thanks
Kosta

Is it the exact same error? I.e.

Parser.php line 157:

 [Icewind\SMB\Exception\Exception]     
Malformed state response from server

Or just similar behavior? It makes a difference. :slight_smile:

Also what version of NC are you using?

Oh, and your OS (unless you’re using containers) matters a great deal since this is SMB (which has odd quirks related to the versions of various dependencies outside of NC).

Lastly, what type of SMB server?

Hello,

I believe so, however I can’t replicate it any more, because I recreated the folder where it stopped, moved only Photo folders there, and then re-ran the command. It went through. I think it was due to .DS-Store files that were generated by Synology, my previous NAS. I then deleted all other files but jpegs. However, the issue is now different, as I posted in another thread.

Latest Nextcloud, Hub v27.0.0.

No containers, standalone virtual machine. SMB target is a TrueNAS share, if that is what you mean.

Well, what you said pushed me to search for alternatives - SMB should be provided by Windows, and is not in my case. So, I mounted TrueNAS folder with NFS into /mnt and then I used an External Storage “Local” to bind it to each user. Seems to work very cleanly, files:scan went through very quickly, detecting all of the files, and now running preview:generate-all, seems also to be working, however this will take hours. We shall see.
Next is then Memories, and that will also most likely take hours.
I also hope that all changes will be detected by Nextcloud when something changes in Photos folder.

I do wonder about the performance though. I still want to see what performs better, NFS or SMB when doing reads and writes from the /mnt folder… but that is another topic :slight_smile:

In any case, thank you for the helpful reply.

Hi. Sorry… been a while. I did not find a solution yet. However, I did create an issue on the PG github and got a response. Since I’m using an older version of Nextcloud (25) still, I can’t test it yet. Maybe this will be of some use to someone.

I also want to add TrueNAS user’s folders to their Nextcloud data. But is this a good idea in the first place? I’ve heard that local storage mounting is faster than SMB, but anyway external SMB mounting gives me bunch of errors like “Malformed state response from server” when uploading more than 100 files.

I’m thinking to mount TrueNAS home users folder in Additional Storage in the Nextcloud configuration and then set the external starage as local pointing to the corresponding directories for users.

But again, is this a good practice, to combine Truenas user’s folder into Nextcloud user’s folder? For example, direct SMB share access say, from windows explorer (generating thumbnails etc.) is much faster than working with them through nextcloud.

My user’s home dirs are terabytes in size, how nextcloud will handle them…