I use IIS with Dispatcher Module where I have to configure custom invalidateHandler
Dispatcher.any:
/invalidateHandler "D:\\Cache\\invalidateHandler.bat"
When page is published I see the following message in dispatcher logs
Executing command: D:\Cache\invalidateHandler.bat "/content/test" "Activate" ""...
Command D:\Cache\invalidateHandler.bat exited with code: 1, status: 1
Invalidate script exited with status 1.
This is the body of the script
echo "Test"
Do you have any idea what is the problem here? Should I configure something more? I was unable to find documentation for dispatcher & IIS regarding this feature.
Views
Replies
Total Likes
Hi @bartek_887 ,
Here are the list of mentioned err codes for windows with possible reasons : https://www.tutorialspoint.com/batch_script/batch_script_return_code.htm
This says that code:1 is for unrecognised command however, echo is a valid command in windows terminal. I was unable to find other relevant documentation for your issue.
Thanks.
@bartek_887 , sometimes it's an issue with access as well. Please make sure the apache/IIS user has read,write,execute access for the script file/location.
Did you try to execute the script manually and see if you were able to run the script?
Hi,
I checked that - I put in in the location where IIS creates cache + checked permissions. Sadly it does not work
Did you try to run the script manually and make sure it's not an issue with script?
Exit code 1 means, it might be an error in the script itself.
https://www.cyberciti.biz/faq/linux-bash-exit-status-set-exit-statusin-bash/
I had similar issues when i was trying to call shell script which is placed at dispatcher level and below debug steps helped me.
1. Make sure it's not an issue with Script. Execute the script manually and make sure the functionality works as expected.
2. Make sure the user has execute rights.
https://bash.cyberciti.biz/guide/Setting_up_permissions_on_a_script
3. Then try calling the script the way you want.
Hope this helps.
I checked the script and it works correctly, no errors when I run it manually. I will check the permissions again.
Views
Like
Replies