Hi @boubcher ,
When you run a workspace manually it runs under your user account, however when you create a workspace to run as an app it will generate an API token that is used to run the workspace. It sounds like the API token permissions need to be updated to grant access to the database connection used by the workspace.
Check out the last section 'API Token Permissions' on the FME Server Connections Runtime Error article for instructions on how to do this.
In FME Server 2020.0 only connections stored as published parameters are detected as workspace dependencies and added to the API token permissions by default, if your tokens are stored in private parameters, or not in a parameter at all this must be granted manually.
In FME Server 2021.0 support has also been added to detect connections as workspace dependencies for token permissions if they are stored in private parameters. Work is still ongoing to be able to detect these when they are not stored as user parameters at all.
Hi @boubcher ,
When you run a workspace manually it runs under your user account, however when you create a workspace to run as an app it will generate an API token that is used to run the workspace. It sounds like the API token permissions need to be updated to grant access to the database connection used by the workspace.
Check out the last section 'API Token Permissions' on the FME Server Connections Runtime Error article for instructions on how to do this.
In FME Server 2020.0 only connections stored as published parameters are detected as workspace dependencies and added to the API token permissions by default, if your tokens are stored in private parameters, or not in a parameter at all this must be granted manually.
In FME Server 2021.0 support has also been added to detect connections as workspace dependencies for token permissions if they are stored in private parameters. Work is still ongoing to be able to detect these when they are not stored as user parameters at all.
@hollyatsafe
Thanks for your response < Ifollow up all step ( API Token Permissions (Server Apps/Webhook/Rest API)
as an Admin in order to grant API permission to the server APP , but still the user is getting failure when running the server app ( Error connecting to PostgreSQL database(host='', port='', dbname='PostGis GDB***', user='', password='***'): 'could not connect to server: Connection refused (0x0000274D/10061) )
@hollyatsafe
Thanks for your response < Ifollow up all step ( API Token Permissions (Server Apps/Webhook/Rest API)
as an Admin in order to grant API permission to the server APP , but still the user is getting failure when running the server app ( Error connecting to PostgreSQL database(host='', port='', dbname='PostGis GDB***', user='', password='***'): 'could not connect to server: Connection refused (0x0000274D/10061) )
Hi @boubcher ,
Hmm that's not good. If the API token used by the workspace app has been given specific access to the DB Connection then this should work exactly as when you run the workspace manually. The 'Connection refused' error makes me think this could be network, rather than permissions related, but then I would expect to see the same error from the running the workspace manually on FME Server.
- What version/build of FME Server are you using?
- Is the connection being used in a Reader/Writer or transformer (and specifically PostGIS of PostgreSQL format?)
- Please share a copy of the job log from the successful run (manually triggered) and from the failed run (workspace app)
If you would prefer not to share the logs on the Community please create a support case instead where we can investigate this further.
@hollyatsafe
thanks for your help I have posted a support case , C652353
looking forward to hear from you