BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
AllanBowe
Barite | Level 11

This thread is in relation to this ticket: https://github.com/sasjs/adapter/issues/829

 

Looking for support here whilst we figure out the root cause (maybe someone is already aware).  It looks like something has changed recently on Viya 4 when it comes to running code in an existing session.

 

This is the request / response (running SASjs CLI with verbose mode):

 

ℹ HTTP Request:          
                                                                                                                   
POST /compute/sessions/ca3f4bdf-3cf8-48b5-91fb-f9f11999789c-ses0000/jobs HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsIREDACTED
User-Agent: axios/0.27.2
Content-Length: 1162
Host: extviya4.emea.sas.com
Connection: close

{
  name: 'myJob',
  description: 'Powered by SASjs',
  code: [
    'data work.demo;',
    '  do x=1 to 1e6;',
    '    y=ranuni(0);',
    '  end;',
    'run;'
  ],
  variables: {
    SYS_JES_JOB_URI: '',
    _program: '/Viyademo08 Group Folder/4GL/proj/yurshk/jobs/long/long',
    _DEBUG: 131
  },
  arguments: {
    _contextName: 'SAS Job Execution compute context',
    _OMITJSONLISTING: true,
    _OMITJSONLOG: true,
    _OMITSESSIONRESULTS: false,
    _OMITTEXTLISTING: true,
    _OMITTEXTLOG: false
  }
}

HTTP Response Code: 400

HTTP Response:
Date: Fri, 01 Sep 2023 15:14:27 GMT
Content-Type: application/vnd.sas.error+json;charset=utf-8;version=2
Content-Length: 470
Connection: close
Set-Cookie: sas-ingress-nginx=9a59cdfa1a238157REDACTED; Path=/compute/; Secure; HttpOnly; SameSite=Lax
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Security-Policy: default-src 'self'; object-src 'none'; frame-ancestors 'self'; form-action 'self';
Expires: 0
Pragma: no-cache
Sas-Service-Response-Flag: true
Vary: Origin
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Strict-Transport-Security: max-age=63072000; includeSubDomains

{
  version: 2,
  httpStatusCode: 400,
  errorCode: 5036,
  message: 'The input provided for this request is not valid for this endpoint. ',
  details: [
    'path: /compute/sessions/ca3f4bdf-3cf8-48b5-91fb-f9f11999789c-ses0000/jobs',
    'correlator: d03057f5-3c73-4a2c-b171-af28f8367024'
  ],
  remediation: 'Check to make sure the request made to the server is a valid request. Contact your system administrator to determine if the request made from your application is formatted correctly.'
}

Checking the API docs the example body does appear to be different however it does not correspond to the referred JobRequest schema.

Does anyone have any working examples, or can see what is wrong with our payload?  It has worked fine for several years until now..

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
1 ACCEPTED SOLUTION

Accepted Solutions
AllanBowe
Barite | Level 11

@YuryShkoda found the issue

 

Seems the "arguments" attribute is no longer supported on the compute API side

 

We use it as our payload is also used for executing Jobs as well as arbitrary code.  Solution is simply to remove that object from the request Body.

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

View solution in original post

1 REPLY 1
AllanBowe
Barite | Level 11

@YuryShkoda found the issue

 

Seems the "arguments" attribute is no longer supported on the compute API side

 

We use it as our payload is also used for executing Jobs as well as arbitrary code.  Solution is simply to remove that object from the request Body.

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

Discussion stats
  • 1 reply
  • 517 views
  • 3 likes
  • 1 in conversation