Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Error Display for Rest Session Errors #1367

Open
smorrisj opened this issue Jan 13, 2025 · 0 comments
Open

Better Error Display for Rest Session Errors #1367

smorrisj opened this issue Jan 13, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@smorrisj
Copy link
Contributor

smorrisj commented Jan 13, 2025

Describe the bug
We should show better error messages when Compute jobs return errors, specifically on Session creation. Currently, only the "top level" error message is being shown to the user, which is not helpful to understand why requests might have failed.

Steps to reproduce
Steps to reproduce the behavior:

  1. Create an autoexec file that has an include statement. Make sure the include file exists:
%include cowboy.sas
  1. Specify the autoexec in the connection profile autoexec config:
        "viyavsc": {
            "connectionType": "rest",
            "endpoint": <omitted>,
           
            "autoExec": [
                {
                    "type": "file",
                    "filePath": <absolute path to autoexec sas file>
                }
            ]
        
       }
  1. Create a sas file to run, for example:
proc sgplot data=sashelp.class;
    histogram height;
    density height;
    density height / type=kernel;
run;
  1. Run the test file in step 3. Observe the error reported as "Request failed with status code 400".
  2. If you observe the actual server log, the real error message is noted:
[00000019] << {"details":["%INCLUDE statements can only be set by an administrator, and not directly in autoExecLines of the session request."],"errorCode":5101,"errors":[],"httpStatusCode":400,"id":"","links":[],"message":"%INCLUDE statements are not allowed in the autoExecLines of the session request.","remediation":"Contact your system administrator for changes to the autoexec content for the context.","version":2} 

Expected behavior
Show the contents of the rest error representation if we receive a response payload that looks like an Error Representation from compute. We have existing examples of how this is done in the run commands. See run.ts. It would also be nice if we could refactor the error detection functions into a place that could be shared by consumers as well.

Additional context
Reported by a WFL user. This issue will affect Viya and Workbench connection types

@smorrisj smorrisj added the bug Something isn't working label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant