Job fails when submitted with a custom application resource template (Streams)

When you submit your job with a custom application resource template, the job fails to start.

Symptoms

Example 1
[streamsops@myinstance-ops-0 ~]$ streamtool submitjob Main.sab -g jco-smallresource.json Main.sab  --User admin
Password:********
CDISC0079I The following number of applications were submitted to the myinstance instance: 1.
CDISA5101E The following application template could not be located: smallresource.yaml.
CDISC5141E The job might not be successfully submitted for the application that has the following path: /home/streamsops/Main.sab. See the previous error message.
Example 2

[streamsops@myinstance-ops-0 ~]$ streamtool
[streamtool <?@myinstance>] submitjob limits.Main.sab -g jco-smallresource.json
User:admin
Password:********
CDISC0079I The following number of applications were submitted to the myinstance instance: 1.
CDISC5093E The following file could not be accessed: /home/streamsops/limits.Main.sab. Check that the permissions of the file are set to allow access. The error is: ERROR: file does not exist.
CDISC5141E The job might not be successfully submitted for the application that has the following path: /home/streamsops/limits.Main.sab. See the previous error message.

[streamtool <admin@myinstance>] submitjob Main.sab -g jco-smallresource.json
CDISC0079I The following number of applications were submitted to the myinstance instance: 1.
CDISA5011E An error occurred parsing the following application template: smallresource.yaml. The error message is 'CDISA5089E An unexpected error occurred. The error message is 'while parsing a block mapping
 in 'reader', line 1, column 1:
    apiVersion: v1
    ^
expected <block end>, but found '<block sequence start>'
 in 'reader', line 5, column 2:
     - name: controller
     ^

 at [Source: (StringReader); line: 5, column: 2]'.'.
CDISC5141E The job might not be successfully submitted for the application that has the following path: /home/streamsops/Main.sab. See the previous error message.
Example 3
Unable to submit application appplication::Main
The job submission or processing element restart failed.
CDISR3074 The operation failed because a resource was not able to be acquired for this resource specification:
Cpu:Res[0.2->1.0]Mem:None Tags:[smallresource]
CDISR3075 The following resources could not be allocated: myInstance-app-11. The error is NOT:Schedulable.

Causes

Example 1
The application resource template doesn't exist.
Example 2
A syntax error exists in the configuration map.
Example 3
An expected persistent volume claim doesn't exist.

Resolving the problem

Example 1: The application resource template doesn't exist.
Create the application resource template. For more information, see Creating a Streams application resource template.
After the resource template is created and the Streams instance is updated with the new configuration map, resubmit your job.
Example 2: A syntax error exists in the configuration map.
Fix the syntax errors in the configuration map that contains the resource template. Typically, syntax errors are related to improper spacing. Apply the updated configuration map by using the following command:
oc apply -f Example_resource_template_-config
Example 3: An expected persistent volume claim doesn't exist.
To verify that the problem is caused by a missing persistent volume claim, resubmit the job. While Streams is trying to start the application, look for the application pods by running this command:
[streamsops@myinstance-ops-0 ~]$ oc get pods | grep Service_instance_name-app
myinstance-app-10                                0/1     Pending     0          36s
myinstance-app-11                                0/1     Pending     0          36s

You see the pods are pending.

Run the following command to see if there are any events. In the following example, you see the persistent volume claim is not found.
oc describe pod Service_instance_name-app-Pod_number
 
Events:
  Type     Reason            Age        From               Message
  ----     ------            ----       ----               -------
  Warning  FailedScheduling  <unknown>  default-scheduler  persistentvolumeclaim "example-resource-template-config-complex-pvc" not found
  Warning  FailedScheduling  <unknown>  default-scheduler  persistentvolumeclaim "example-resource-template-config-complex-pvc" not found

To resolve this issue, create the persistent volume claim and resubmit the job. For information about creating a persistent volume claim, see the Red Hat® OpenShift® documentation for Persistent storage for your storage type.