Known Issue: FME Server Web Connection fails with Reason - credentials for user are invalid

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2021.0
Known Issue ID FMESERVER-18350
Discovered 2021.2
Affects 2021.0 +
Resolved 2022.1 b22622 +

Symptom

When you publish a workspace that contains an FME Server transformer e.g. FMEServerJobSubmitter, FMEServerLogFileRetriever, FMEServerNotifier, FMEServerJobWaiter, or FMEServerResourceConnector configured with an FME Server Web Connection the workspace will run successfully for one week. HTTPCallers may also be affected. After this time the workspace will fail with the error: 

Reason - credentials for user '<username>' are invalid

If you try and use this connection in FME Workbench you'll receive a similar error:

Login failed (Not Authenticated) - Authentication failed: Failed to login

until you reauthorize the connection. 

 

Cause 

When you first upload an FME Server Web Connection to FME Server it will generate a token that expires after one week. After the token has expired FME Server is unable to reauthorize the connection and generate a new token for use within the workspace. 

 

Workaround

Option 1 is the recommended workaround because it does not require any changes to existing workspaces, so is the simplest method to implement. 

 

Option 1: Refresh Web Connection Token on a Schedule

The issue is occurring because the token is expiring and FME is unable to automatically refresh the token. It's possible to make a REST API call to update the token to extend the expiry date. This can be achieved in Automation: 

  1. Open the FME Server Web UI and select Automations > Build Automation
  2. Add a Schedule Trigger and set the following parameters: 
    1. Schedule Type: Repeat on Interval
    2. Repeat every: 6 Days
    3. Date Range - Start: Start Immediately
    4. Date Range - End: Does not Expire
  3. Add an HTTP Request External Action and set the following parameters: 
    1. Request Type: PUT
    2. Request URL: <FME_Server_Web_URL>/fmerest/v3/tokens/<Username>/<TokenName>
    3. HTTP Authentication User Name: <Username>
    4. HTTP Authentication Password: <Password>
    5. Verify SSL Certificates: No
    6. HTTP Body: 
      {
        "description": "FME Server Web Connection",
        "expirationTimeout": 604800,
        "enabled": true
      }
      where:
      •  <FME_Server_Web_URL> is URL to access your FME Server e.g. http(s)://<hostname>.<domain>:<port>
      • <Username> is your FME Server username 
      • <Password> is your FME Server password
      • <TokenName> is the name of the token tied to your FME Server Web Connection and is used in the Request URL. This can be found on the Manage Tokens Page and will look like 'Token Service Login - <UUID>
  4. Save and start the Automation.
  5. The schedule should trigger immediately, check the Automation log as well as your token to make sure the request was successful. 


Note, in this example, the token is set to expire after 7 days, but the schedule is run every 6 days to refresh the token, hence it will never expire.  

Alternatively, you can download the attached workspace to run on a schedule instead of the HTTP Request, but this occupies an engine, so may not be preferable on a busy server. 
 

Option 2: Embed Credentials

Update the configuration of the transformer to 'Embed Connection Credentials'. 

 

Option 3: Use Automations

If you encountered this issue using the FMEServerJobSumitter then you could use Automations as an alternative to the parent workflow to chain your workspaces together. 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.