Rename File on Update

Hi, trying to get this to work, and am a bit confused that I keep getting this error:
[Plugin / Rename File on Update] GRAPHQL_ERROR:[‘moveFiles’] folder path /data/Vixen must be within a stash library path

I get this error even when I leave the default directory setting blank, so that it is actually not moving the file, just renaming in place

Edit: in case someone faces the same problem later. It was simply that in the stash Library setting I had entered “data” instead of “/data”. Took me a while to figure out, because I had to delete and re-add the library path to fix it - editing it didn’t do the trick.

I did discover another small problem however. For the re-naming, it removes illegal characters (colon:) in the file name, but it doesn’t remove it as expected in the file path

Attached with a fix for the illegal characters in name issue and also the oldpath issue. I vibe-coded this so use with caution, but seems to work

file_manager.py (8.0 KB)

1 Like

I already made a pull request to fix illegal characters in the directory name. Check the github.

Tried looking through all the comments here and still get this error:

In the error below I changed the name of the file I was renaming to with the “file name format” I’m using in stash in case I typed something wrong there. Looks like though it doesn’t like the file extension mine is set as?

Info Scan finished (1.0922422s)
Error Scene.Update.Post [Rename File on Update]: returned error: exit status 1
Error [Plugin / Rename File on Update] Exception: 200 OK query failed. v0.30.1-0
Error [Plugin / Rename File on Update] raise Exception(error_msg)
Error [Plugin / Rename File on Update] File “C:\Users\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\stashapi\classes.py”, line 271, in _handle_GQL_response
Error [Plugin / Rename File on Update] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error [Plugin / Rename File on Update] return self._handle_GQL_response(response)
Error [Plugin / Rename File on Update] File “C:\Users\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\stashapi\classes.py”, line 228, in _GQL
Error [Plugin / Rename File on Update] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error [Plugin / Rename File on Update] return self._GQL(query, variables)
Error [Plugin / Rename File on Update] File “C:\Users\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\stashapi\stashapp.py”, line 242, in call_GQL
Error [Plugin / Rename File on Update] ^^^^^^^^^^^^^^^^^^^^
Error [Plugin / Rename File on Update] moved_file = self.stash.call_GQL(
Error [Plugin / Rename File on Update] File “C:\Users.stash\plugins\rename-file-on-update\file_manager.py”, line 209, in rename_file
Error [Plugin / Rename File on Update] stash_file.rename_file()
Error [Plugin / Rename File on Update] File “C:\Users.stash\plugins\rename-file-on-update\renamer.py”, line 50, in rename_scene
Error [Plugin / Rename File on Update] rename_scene(stash, config, ARGS)
Error [Plugin / Rename File on Update] File “C:\Users.stash\plugins\rename-file-on-update/rename_file_on_update.py”, line 23, in
Error [Plugin / Rename File on Update] Traceback (most recent call last):
Error [Plugin / Rename File on Update] d
Error [Plugin / Rename File on Update] d
Error [Plugin / Rename File on Update] 200 OK query failed. v0.30.1-0
Error [Plugin / Rename File on Update] 200 OK GQL data response is null
Error [Plugin / Rename File on Update] GRAPHQL_ERROR:[‘moveFiles’] file extension for [$studio_name$] - $title$ - [$date$] [$video_codec$] [$width$p] is inconsistent with old filename oldtitle.mkv
Error moveFiles: input: moveFiles file extension for [$studio_name$] - $title$ - [$date$] [$video_codec$] [$width$p] is inconsistent with old filename old.mkv
Info [Plugin / Rename File on Update] Renaming file from X:\OtherTemp\old.mkv to X:\Other_Rename[$studio_name$] - $title$ - [$date$] [$video_codec$] [$width$p]
Info renaming X:\StashInfo\vtt\03c17d44919039df_sprite.jpg to X:\StashInfo\vtt\627e4081bf2f2e33_sprite.jpg
Info renaming X:\StashInfo\vtt\03c17d44919039df_thumbs.vtt to X:\StashInfo\vtt\627e4081bf2f2e33_thumbs.vtt
Info renaming X:\StashInfo\screenshots\03c17d44919039df.mp4 to X:\StashInfo\screenshots\627e4081bf2f2e33.mp4
Info Removing outdated checksum from X:\OtherTemp\old.mkv
Info Calculating fingerprints for X:\OtherTemp\old.mkv …
Info X:\OtherTemp\old.mkv has been updated: rescanning
Info Finished adding files to queue. 1 files queued
Info scanning 1 paths

1 Like

Is it possible to designate a tag and only if that tag is present in the metadata add it to the renamed file name? I just want VR (LR, SBS, 180…) tags to be included in the file name no other tags.

1 Like

What kind path and filename do you use?
I have been using the scene name, but for a small percentage of files there are some inconsistencies between whisparr and this plugin in the way it removes illegal characters

Currently using, for this plugin:
/scenes/$studio_name$/$date$ - $title$

For Whisparr:
/scenes/{Studio Title}/{Release Date} - {Scene CleanTitle}

I have been able to get the plugin working successfully for a portion of my library. However under some circumstances the File Directory updates with some of my content is causing the entirety of my Stash docker to hang and not respond until it is restarted. In this case none of the files get renamed or moved to the new directory. The file renaming or performing a dry run both work without issue. Looking in the logs I am seeing near constant logs being created under the “trace” that continue indefinitely even when completing an update to just a single file.

2026-01-26 20:22:17Trace   SQL \[64.1µs\]: SELECT \`folders\`.\`id\`, \`folders\`.\`path\`, \`folders\`.\`zip_file_id\`, \`folders\`.\`parent_folder_id\`, \`folders\`.\`mod_time\`, \`folders\`.\`created_at\`, \`folders\`.\`updated_at\`, \`zip_files\`.\`basename\` AS \`zip_basename\`, \`zip_files_folders\`.\`path\` AS \`zip_folder_path\`, \`zip_files\`.\`size\` AS \`zip_size\` FROM \`folders\` LEFT JOIN \`files\` AS \`zip_files\` ON (\`folders\`.\`zip_file_id\` = \`zip_files\`.\`id\`) LEFT JOIN \`folders\` AS \`zip_files_folders\` ON (\`zip_files\`.\`parent_folder_id\` = \`zip_files_folders\`.\`id\`) WHERE (\`folders\`.\`path\` = ?), args: \[/\]

2026-01-26 20:22:17Trace   SQL \[67.372µs\]: SELECT \`folders\`.\`id\`, \`folders\`.\`path\`, \`folders\`.\`zip_file_id\`, \`folders\`.\`parent_folder_id\`, \`folders\`.\`mod_time\`, \`folders\`.\`created_at\`, \`folders\`.\`updated_at\`, \`zip_files\`.\`basename\` AS \`zip_basename\`, \`zip_files_folders\`.\`path\` AS \`zip_folder_path\`, \`zip_files\`.\`size\` AS \`zip_size\` FROM \`folders\` LEFT JOIN \`files\` AS \`zip_files\` ON (\`folders\`.\`zip_file_id\` = \`zip_files\`.\`id\`) LEFT JOIN \`folders\` AS \`zip_files_folders\` ON (\`zip_files\`.\`parent_folder_id\` = \`zip_files_folders\`.\`id\`) WHERE (\`folders\`.\`path\` = ?), args: \[/\]

2026-01-26 20:22:17Trace   SQL \[65.572µs\]: SELECT \`folders\`.\`id\`, \`folders\`.\`path\`, \`folders\`.\`zip_file_id\`, \`folders\`.\`parent_folder_id\`, \`folders\`.\`mod_time\`, \`folders\`.\`created_at\`, \`folders\`.\`updated_at\`, \`zip_files\`.\`basename\` AS \`zip_basename\`, \`zip_files_folders\`.\`path\` AS \`zip_folder_path\`, \`zip_files\`.\`size\` AS \`zip_size\` FROM \`folders\` LEFT JOIN \`files\` AS \`zip_files\` ON (\`folders\`.\`zip_file_id\` = \`zip_files\`.\`id\`) LEFT JOIN \`folders\` AS \`zip_files_folders\` ON (\`zip_files\`.\`parent_folder_id\` = \`zip_files_folders\`.\`id\`) WHERE (\`folders\`.\`path\` = ?), args: \[/\]

2026-01-26 20:22:17Trace   SQL \[66.271µs\]: SELECT \`folders\`.\`id\`, \`folders\`.\`path\`, \`folders\`.\`zip_file_id\`, \`folders\`.\`parent_folder_id\`, \`folders\`.\`mod_time\`, \`folders\`.\`created_at\`, \`folders\`.\`updated_at\`, \`zip_files\`.\`basename\` AS \`zip_basename\`, \`zip_files_folders\`.\`path\` AS \`zip_folder_path\`, \`zip_files\`.\`size\` AS \`zip_size\` FROM \`folders\` LEFT JOIN \`files\` AS \`zip_files\` ON (\`folders\`.\`zip_file_id\` = \`zip_files\`.\`id\`) LEFT JOIN \`folders\` AS \`zip_files_folders\` ON (\`zip_files\`.\`parent_folder_id\` = \`zip_files_folders\`.\`id\`) WHERE (\`folders\`.\`path\` = ?), args: \[/\]

Here is what I am using for the config for the filename and directory:
Default directory path format

/data/$studio_name$/$title$

Default file name format

$studio_name$ - $date$ - $title$.$ext$

The studio for this example is Vixen and I have tried having /data, and /data/Vixen both setup up at the same time and individually as a directory within my library in Stash and I still run into the problem.

The one thing that sticks out to me that works vs when it doesn’t is if the file are already in the /$studio_name$ path then it works. However, If I have it in a miscellaneous directory it will hang.

Works:
Studio: Vixen
/data/Vixen/$filename$ → /data/Vixen/$title/$filename$

Does not work:
Studio: Vixen
/data/Miscellaneous/Vixen/$filename$ → /data/Vixen/$title$/$filename$

Any suggestions would be appreciated!

I am running Ubuntu 24.x but I can’t get Rename File on Update to do anything. I am constantly getting error messages.

26-02-08 17:34:16Info [Plugin / Whisparr Bridge] scene ‘Emma Hix Casting’, id=2313

2026-02-08 17:34:16Info [Plugin / Whisparr Bridge] No matching StashDB id; skip.

2026-02-08 17:34:16Debug [Plugin / Whisparr Bridge] Using stash (v0.30.1-0) endpoint at http://127.0.0.1:9999/graphql

2026-02-08 17:34:16Debug Plugin Whisparr Bridge started: /usr/bin/python3 plugins/whisparr-bridge/whisparr-bridge.py

2026-02-08 17:34:16Error Scene.Update.Post [Rename File on Update]: returned error: exit status 1

2026-02-08 17:34:16Debug Plugin Rename File on Update finished

2026-02-08 17:34:16Error [Plugin / Rename File on Update] raise Exception(error_msg)

2026-02-08 17:34:16Error [Plugin / Rename File on Update] Exception: 200 OK query failed. v0.30.1-0

2026-02-08 17:34:16Error [Plugin / Rename File on Update] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2026-02-08 17:34:16Error [Plugin / Rename File on Update] File “/usr/local/lib/python3.12/dist-packages/stashapi/classes.py”, line 271, in _handle_GQL_response

2026-02-08 17:34:16Error [Plugin / Rename File on Update] return self._handle_GQL_response(response)

2026-02-08 17:34:16Error [Plugin / Rename File on Update] ^^^^^^^^^^^^^^^^^^^^^^^^^^^

2026-02-08 17:34:16Error [Plugin / Rename File on Update] return self._GQL(query, variables)

2026-02-08 17:34:16Error [Plugin / Rename File on Update] File “/usr/local/lib/python3.12/dist-packages/stashapi/classes.py”, line 228, in _GQL

2026-02-08 17:34:16Error [Plugin / Rename File on Update] ^^^^^^^^^^^^^^^^^^^^

2026-02-08 17:34:16Error [Plugin / Rename File on Update] File “/usr/local/lib/python3.12/dist-packages/stashapi/stashapp.py”, line 242, in call_GQL

2026-02-08 17:34:16Error [Plugin / Rename File on Update] moved_file = self.stash.call_GQL(

2026-02-08 17:34:16Error [Plugin / Rename File on Update] stash_file.rename_file()

2026-02-08 17:34:16Error [Plugin / Rename File on Update] File “/opt/stash/plugins/rename-file-on-update/file_manager.py”, line 209, in rename_file

2026-02-08 17:34:16Error [Plugin / Rename File on Update] File “/opt/stash/plugins/rename-file-on-update/renamer.py”, line 50, in rename_scene

2026-02-08 17:34:16Error [Plugin / Rename File on Update] Traceback (most recent call last):

2026-02-08 17:34:16Error [Plugin / Rename File on Update] File “/opt/stash/plugins/rename-file-on-update/rename_file_on_update.py”, line 23, in

2026-02-08 17:34:16Error [Plugin / Rename File on Update] rename_scene(stash, config, ARGS)

2026-02-08 17:34:16Error [Plugin / Rename File on Update] d

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] }

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] moveFiles(input: $input)

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] Variables: {‘input’: {‘ids’: [‘2320’], ‘destination_folder’: ‘/opt/stash/Woodman/Woodman’, ‘destination_basename’: ‘2016-07-09 - Emma Hix Casting $performers$ [$stash_id$]’}}

2026-02-08 17:34:16Error [Plugin / Rename File on Update] d

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] mutation MoveFiles($input: MoveFilesInput!) {

2026-02-08 17:34:16Error [Plugin / Rename File on Update] 200 OK GQL data response is null

2026-02-08 17:34:16Error [Plugin / Rename File on Update] GRAPHQL_ERROR:[‘moveFiles’] folder path /opt/stash/Woodman/Woodman must be within a stash library path

2026-02-08 17:34:16Error [Plugin / Rename File on Update] 200 OK query failed. v0.30.1-0

2026-02-08 17:34:16Error moveFiles: input: moveFiles folder path /opt/stash/Woodman/Woodman must be within a stash library path

2026-02-08 17:34:16Info [Plugin / Rename File on Update] Renaming file from /media/adults/scenes/woodman- Emma Hix - CastingX.mkv to /opt/stash/Woodman/Woodman/2016-07-09 - Emma Hix Casting $performers$ [$stash_id$]

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] Checking if a file exists at /opt/stash/Woodman/Woodman/2016-07-09 - Emma Hix Casting $performers$ [$stash_id$]

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] Found scene: {‘id’: ‘2313’, ‘title’: ‘Emma Hix Casting’, ‘code’: ‘emma-hix-8905’, ‘date’: ‘2016-07-09’, ‘organized’: True, ‘studio’: {‘id’: ‘94’, ‘name’: ‘Woodman’, ‘parent_studio’: None}, ‘files’: [{‘id’: ‘2320’, ‘path’: ‘/media/adults/scenes/woodman- Emma Hix - CastingX.mkv’, ‘basename’: ‘woodman- Emma Hix - CastingX.mkv’, ‘format’: ‘matroska’, ‘width’: 1920, ‘height’: 1080, ‘duration’: 4242.96, ‘video_codec’: ‘hevc’, ‘audio_codec’: ‘aac’}]}

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] Checking scene with args: {‘hookContext’: {‘id’: 2313, ‘type’: ‘Scene.Update.Post’, ‘input’: {‘clientMutationId’: None, ‘id’: ‘2313’, ‘title’: ‘Emma Hix Casting’, ‘code’: ‘emma-hix-8905’, ‘details’: ‘A canadian girl, Emma Hix has an audition with Pierre Woodman. She will answer general questions about her life and sexual fantasies and experience. Then Emma Hix will undress to show her body naked. She will be asked to show her body in doggy style and missionary position on a sofa. Then Pierre convince Emma Hix to have a 100% real sex with him,and he will fuck her very hard. This is Emma Hix sex Testing casting X !’, ‘director’: None, ‘url’: None, ‘urls’: [‘Emma Hix on Woodman casting X | Official website’], ‘date’: ‘2016-07-09’, ‘rating100’: None, ‘o_counter’: None, ‘organized’: True, ‘studio_id’: None, ‘gallery_ids’: None, ‘performer_ids’: None, ‘movies’: None, ‘groups’: None, ‘tag_ids’: [‘231’, ‘78’, ‘23’, ‘907’, ‘41’, ‘877’, ‘977’, ‘595’, ‘168’, ‘909’, ‘142’, ‘9’, ‘364’, ‘63’, ‘914’], ‘cover_image’: ‘’, ‘endpoint’: ‘https://theporndb.net/graphql’, ‘updated_at’: ‘2026-02-08T17:34:16.17373848-06:00’}], ‘resume_time’: None, ‘play_duration’: None, ‘play_count’: None, ‘primary_file_id’: None}, ‘inputFields’: [‘title’, ‘code’, ‘details’, ‘urls’, ‘date’, ‘organized’, ‘tag_ids’, ‘cover_image’, ‘stash_ids’]}}

2026-02-08 17:34:16Debug [Plugin / Rename File on Update] Using stash (v0.30.1-0) endpoint at http://127.0.0.1:9999/graphql

2026-02-08 17:34:16Debug Plugin Rename File on Update started: /usr/bin/python3 plugins/rename-file-on-update/rename_file_on_update.py

2026-02-08 17:34:16Debug Scene.Update.Post [mcMetadata]: returned: 0xc0101a59f0

2026-02-08 17:34:16Debug Plugin mcMetadata finished

2026-02-08 17:34:16Debug [Plugin / mcMetadata] Hook disabled, skipping

2026-02-08 17:34:16Info [Plugin / mcMetadata] [DRY RUN] Mode enabled - no changes will be made

2026-02-08 17:34:16Debug [Plugin / mcMetadata] Dry run: True

2026-02-08 17:34:16Debug [Plugin / mcMetadata] Plugin mode: Scene.Update.Post

2026-02-08 17:34:16Debug [Plugin / mcMetadata] stashapp-tools version: 0.2.59

2026-02-08 17:34:16Debug [Plugin / mcMetadata] Using stash (v0.30.1-0) endpoint at http://127.0.0.1:9999/graphql

2026-02-08 17:34:16Debug Plugin mcMetadata started: /usr/bin/python3 plugins/mcMetadata/mcMetadata.py

2026-02-08 17:34:16Info Successfully identified /media/adults/scenes/woodman- Emma Hix - CastingX.mkv as Emma Hix Casting using stash-box: https://theporndb.net/graphql

I am not sure why it’s looking into /opt/stash/ to do the move?? My library root in stash is /media/adults

Hi Guys, hoping someone might be able to help me.

I’ve tried following all of the help given above but every time I run the Renamer plugin in it’s completed in 1.X seconds and nothing changes, does anyone have any ideas.

Also is it possible to have Performer as a format specifier at all?

This is what I get from the log:

26-02-09 14:28:20Debug Plugin returned: 0xc000051490

2026-02-09 14:28:20Debug Plugin Rename File on Update finished

2026-02-09 14:28:20Info [Plugin / Rename File on Update] Checking all scenes

2026-02-09 14:28:20Debug [Plugin / Rename File on Update] Using stash (v0.30.1-0) endpoint at http://127.0.0.1:9999/graphql

2026-02-09 14:28:18Debug Plugin Rename File on Update started: C:\Python\Python314\python.exe C:\Users\danco\.stash\plugins\community\rename-file-on-update/rename_file_on_update.py

2026-02-09 14:28:18Trace using configured python path: C:\Python\Python314\python.exe

Hi,

I wonder…

Is there a way for the Plugin “Rename File on Update” to also include the filename.funscript?

Thank you for making this plugin :folded_hands:

1 Like

Having a similar issue, using Stash in a docker container.

2026-04-12 14:48:10Error Scene.Update.Post [Rename File on Update]: returned error: exit status 1

2026-04-12 14:48:10Error [Plugin / Rename File on Update] AttributeError: ‘StashInterface’ object has no attribute ‘call_GQL’. Did you mean: ‘callGQL’?

2026-04-12 14:48:10Error [Plugin / Rename File on Update] ^^^^^^^^^^^^^^^^^^^

2026-04-12 14:48:10Error [Plugin / Rename File on Update] moved_file = self.stash.call_GQL(

2026-04-12 14:48:10Error [Plugin / Rename File on Update] File “/config/plugins/awesomeness/rename-file-on-update/file_manager.py”, line 209, in rename_file

2026-04-12 14:48:10Error [Plugin / Rename File on Update] ~~~~~~~~~~~~~~~~~~~~~~^^

2026-04-12 14:48:10Error [Plugin / Rename File on Update] stash_file.rename_file()

2026-04-12 14:48:10Error [Plugin / Rename File on Update] File “/config/plugins/awesomeness/rename-file-on-update/renamer.py”, line 50, in rename_scene

2026-04-12 14:48:10Error [Plugin / Rename File on Update] ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^

2026-04-12 14:48:10Error [Plugin / Rename File on Update] rename_scene(stash, config, ARGS)

2026-04-12 14:48:10Error [Plugin / Rename File on Update] File “/config/plugins/awesomeness/rename-file-on-update/rename_file_on_update.py”, line 23, in

2026-04-12 14:48:10Error [Plugin / Rename File on Update] Traceback (most recent call last):

2026-04-12 14:48:10Info [Plugin / Rename File on Update] Renaming file from /oldfolder/oldname.ext to /newfolder/newname.ext

It sees the files, it gets the new filename right, it just doesn’t do the renaming.

Can this rename files with performer names? I was hoping (Title) (Performer) (Date).ext Also if I have filenames that are just random letters with no info, will it pull the data from Stash?

Did you found a solution for this? Have the same issue.

Nope, haven’t gotten it to work so far.