I also for got to mention something else:
The log file displays "FME Configuration: Current working folder is `C:\\Windows\\System32"
Why would the "Working Folder" be set to System32?
I did check FME Options and did not find anything relating to this. So I don't know what it means.
Thanks,
Sameer
When you're running it through the batch file or task scheduler does the user account under which it runs have the same permissions as when you're doing it interactively? In the first one it seems to indicate it can't find the MDB, second one could be related to that too.
When you're running it through the batch file or task scheduler does the user account under which it runs have the same permissions as when you're doing it interactively? In the first one it seems to indicate it can't find the MDB, second one could be related to that too.
@redgeographics:
Hello,
Thank you for getting back to me. If I log on using the Service Account used to run the scheduled task I get the below results:
1) Command Prompt run as Admin
2)Command Prompt run as normal
There's definitely an issue there.
I cannot comprehend why my other FME scheduled task works as normal except for these 2.
Meanwhile I'll carry on investigating.
Regards,
Sameer
When you're running it through the batch file or task scheduler does the user account under which it runs have the same permissions as when you're doing it interactively? In the first one it seems to indicate it can't find the MDB, second one could be related to that too.
@redgeographics
I've checked the path as well, The service account has access to it. In fact it should because it is used elsewhere on most our servers for that purpose.
I've investigated the issue further and discovered the following:
1) I logged on to my server using the service account.
2) Since the log indicated that the Reader could not make a connection, I therefore opened the workspace to analyse it.
3) This is what I saw:
Let's look at the setting:
The error displayed does match with the initial error in the log file generated when the script is running.
4) I've re-checked the FME Connection Storage options:
5) The workspaces were created under the Admin account therefore the default path for Data Connection Storage is: C:\\Users\\Admin...\\AppData\\Roaming\\Safe Software\\FME
Conclusion:
When script is running under service account, it cannot make a connection because fme_connections.data, namedConnecitons.data and/or any other files can't be found. That's my guess or assumption anyway. So I believe changing the default path to a location whereby it can be read by any other user accounts would cure the problem.
Question:
What's the best way to proceed in order to test further? Do I just copy paste all the files to a different folder accessed by all and then change the default path in FME options dialog box?
https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!NamedConnections/options_database_connections.htmPS: All the scripts failed actually. The one I thought was working in fact didn't. It was a false positive. Thank you Microsoft!
Many Thanks,
Sameer
I've investigated the issue further and discovered the following:
1) I logged on to my server using the service account.
2) Since the log indicated that the Reader could not make a connection, I therefore opened the workspace to analyse it.
3) This is what I saw:
Let's look at the setting:
The error displayed does match with the initial error in the log file generated when the script is running.
4) I've re-checked the FME Connection Storage options:
5) The workspaces were created under the Admin account therefore the default path for Data Connection Storage is: C:\\Users\\Admin...\\AppData\\Roaming\\Safe Software\\FME
Conclusion:
When script is running under service account, it cannot make a connection because fme_connections.data, namedConnecitons.data and/or any other files can't be found. That's my guess or assumption anyway. So I believe changing the default path to a location whereby it can be read by any other user accounts would cure the problem.
Question:
What's the best way to proceed in order to test further? Do I just copy paste all the files to a different folder accessed by all and then change the default path in FME options dialog box?
https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!NamedConnections/options_database_connections.htmPS: All the scripts failed actually. The one I thought was working in fact didn't. It was a false positive. Thank you Microsoft!
Many Thanks,
Sameer
Aaah, that makes sense. Yes, storing the connections file in a location accessible from all accounts would do the trick.
Aaah, that makes sense. Yes, storing the connections file in a location accessible from all accounts would do the trick.
Do you know how to go about doing it?
I'v copy/pasted all the files to a different location and changed the default path for Data/Public Key/Private Key.
This time the service account picks up the database connection but can't connect. I've just rebooted the server just in case.
Do you know how to go about doing it?
I'v copy/pasted all the files to a different location and changed the default path for Data/Public Key/Private Key.
This time the service account picks up the database connection but can't connect. I've just rebooted the server just in case.
I've never had to do this myself, there might be a clue in
this discussion. (also pinging @SteveAtSafe)
I've never had to do this myself, there might be a clue in
this discussion. (also pinging @SteveAtSafe)
Thanks for your help. I'll check link and liaise with Steve.
Cheers,
Sameer
Resolution:
Thank you @redgeographics for directing me to that post which led to the resolution of my issue.
I still had to make few adjustments though, after trials & mistakes, despite what was described.
1) Copy/Pasted the "FME" folder from %\\AppData%\\Roaming\\Safe Software\\ to another Local Drive whilst logged on as Admin
2) Reconfigured FME Options "Default Paths" to:
3) Allow "Public Access" to the Database Connections due to encryption otherwise it will not be seen when logged on as another user (will default to fme_privateKey.jceks if not set):
4) Logged on using the "Service Account" this time and changed the FME Options for "Default Paths" to match Step 2.
The scripts which relied on the Oracle/Postgres connections completed successfully when initiated from Windows Task Scheduler.
The script which had to make a connection to AcessDB failed because it needed a UNC path in the Reader parameter. My UNC path is basically a DFS symbolic link. I guess Windows Task Scheduler cannot see it because it requires its explicit path whilst running it as not fully logged on for the drive to be mapped but that's a different topic.
If the above is actually wrongly explained, please let me know.
If you've found a different approach I'd also be interested.
Is there an official documentation for this process?
Many Thanks,
Sameer
Do you know how to go about doing it?
I'v copy/pasted all the files to a different location and changed the default path for Data/Public Key/Private Key.
This time the service account picks up the database connection but can't connect. I've just rebooted the server just in case.
If I'm not mistaken, the connection file databases are encrypted using user entropy, which means that you'll have to re-create the database connections as the user who intends to use them. Simply copying the files won't work, for security reasons.
Either that, or use embedded connection parameters.
If I'm not mistaken, the connection file databases are encrypted using user entropy, which means that you'll have to re-create the database connections as the user who intends to use them. Simply copying the files won't work, for security reasons.
Either that, or use embedded connection parameters.
What I've done to populate the Database Connections for my Service Account user is copy/paste the FME contents from Admin account AppData... to Service Account AppData...
I then made the connections Public in my Admin account. All Database Connections were then populated when logged on using my Service Account after reconfiguring Default Paths for my Service Account user . I actually did not have to re-create anything which is something I did not want to do.
I hope that makes sense.