Distribution fails after SAS® Visual Analytics is upgraded from SAS® Viya 3.4 to a later SAS® Viya release


Overview

After you upgrade SAS Visual Analytics 8.3x on SAS Viya 3.4 to a later release, distributions might no longer work. The common symptoms are as follows:

There is no execution environment for job type REST.

Note: This same error might also be seen when you attempt to save a new distribution, and if you try to execute the distribution from the Scheduling tab in Jobs and Flows.

This problem occurs when the job definition for distribution is not updated along with the rest of the product.

 

Resolution

To remedy this situation, you can delete the existing job definition, and then restart the Report Distribution microservice so that the job definition is re-created in the correct format.  

To do this, you must first run a command to get an access token. Run this command from the Linux machine where the Report Distribution microservice is installed. In the following code, fill in appropriate values for <server-name>, <admin-user>, and <admin-password>.

curl -X POST 'http://<server-name>/SASLogon/oauth/token' \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -d 'grant_type=password&username=<admin-user>&password=<admin-password>' \
      -H  'Authorization: Basic c2FzLmVjOg=='


This code returns JSON output, that will start like this:

  
    {"access_token":"<this is where the very long token is>","token_type":"bearer","expires_in":43199,"scope":....
 

The first item is a very long bearer token that you must copy and then paste. Replace the long string in the following sample command with your copied token. When you run this command, it deletes the job definition for report distribution. In the following command, replace the <server-name> and the <very-long-token> with the correct values as described previously.

curl -v --request DELETE \
  --url http://<server-name>/jobDefinitions/definitions/7b5ef82d-19e3-46e1-81eb-cf15b89ce303 \
  --header 'Accept: */*' \
  --header 'Authorization: Bearer <very-long-token>'

 

After this, restart the Report Distribution microservice in order to generate the new job definition.

sudo systemctl restart sas-viya-reportdistribution-default


Verifying the Change

To check that the job definition was updated to the correct value, submit this URL after you have authenticated to the environment.

http(s)://[your-server-here]/jobDefinitions/definitions/7b5ef82d-19e3-46e1-81eb-cf15b89ce303

In the results, look for Execute distribution request. The type should be REPORTDISTRIBUTION.