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

REST-Interface Failing for Moonshine in 0.1.23 #13

Open
JoelProminic opened this issue Feb 4, 2025 · 4 comments
Open

REST-Interface Failing for Moonshine in 0.1.23 #13

JoelProminic opened this issue Feb 4, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@JoelProminic
Copy link
Collaborator

JoelProminic commented Feb 4, 2025

I created a new instance of hcl_domino_standalone_provisioners and did a test with Moonshine for #10, but I found that the calls to the REST-Interface (1.2.0) were failing.

Upload:

# curl -X "POST" "http://restapi.test-standalone.shi.com:8080/file/upload" \
>      -H "Accept: application/json" \
>      -H "Content-Type: multipart/form-data" \
>      -F "[email protected]"
{"error":500,"message":"There was an error","data":null}[

 Caused by: java.io.FileNotFoundException: /opt/restinterface/public/uploads/jedi-github-temp.zip (No such file or directory)

In this case, /opt/restinterface was missing. This path name is out-of-date.

After clearing that, I got this error on /task. I see this error was previously reported in this issue (UPDATED):

# curl -X "POST" "http://restapi.test-standalone.shi.com:8080/task" \
>      -H "Accept: application/json" \
>      -H "Content-Type: application/x-www-form-urlencoded" \
>      --data-urlencode "command=ls -alh" \
>      --data-urlencode "timeout=30"
{"id":2,"startDate":"2025-02-04T21:20:18Z","workingDir":"/opt/restinterface/userfiles","command":"ls -alh","username":null,"errorMessage":null,"timeout":30,"output":null,"taskStatus":"EXECUTING","exitStatus":null}%1~ %# 
# 
# curl "http://restapi.test-standalone.shi.com:8080/task/2"
{"id":2,"startDate":"2025-02-04T21:20:18Z","workingDir":"/opt/restinterface/userfiles","command":"ls -alh","username":null,"errorMessage":"Cannot run program \"bash\" (in directory \"/opt/restinterface/userfiles\"): error=2, No such file or directory","timeout":30,"output":null,"taskStatus":"FAILED","exitStatus":null}%1~ %# 

The configuration looks like this:

$ sudo cat /opt/rest-interface/config/application.yml
grails:
    controllers:
        upload:
            maxFileSize: 104857600
            maxRequestSize: 104857600
restinterface:
    capabilities:
        - upload-database
        - upload-html
        - java-domino-gradle
        - nsfodp
        - import-domino-json
    serverInfo:
        dominoVersion: '14.0.0'
        serverName: test-standalone.shi.com/STARTcloud
        baseURL: https://domino.test-standalone.shi.com

We don't need or want the full authentication configuration that we use for moonshinedev_provisioner_private at the moment - this would require updates to Moonshine. I'm wondering if there is new configuration we should be taking care of for the temporary path, though.

This issue is a low priority, since we are moving towards moonshine.dev instead of Moonshine-IDE for these actions. I don't want these update to interfere with the JeDI integration.

@JoelProminic JoelProminic added the bug Something isn't working label Feb 4, 2025
@solaechea
Copy link
Contributor

Joel, I think you pasted the wrong link here:

After clearing that, I got this error on /task. I see this error was previously reported in #13:

Do you have a link to the related ticket?

@solaechea
Copy link
Contributor

solaechea commented Feb 5, 2025

@JoelProminic

In this case, /opt/restinterface was missing. This path name is out-of-date.

That's still the default path in the configuration, but you can override it by using the external application.yml.

It looks like the path /opt/restinterface/userfiles doesn't exist:

(in directory "/opt/restinterface/userfiles"): error=2, No such file or directory

The REST-Interface should have created that folder on startup, if that wasn't the case then it's probably because the "system user" running the REST-Interface's java process doesn't have permissions to create that directory.

@JoelProminic
Copy link
Collaborator Author

Yeah, I meant to link to issue 13 in another repository.

I confirmed the problem was that /opt/restinterface/userfiles was missing. When I created this manually, the error cleared. I misread that error and thought that "bash" was the problem - maybe that was the actual problem in the above issue as well!

I think it may make sense to update the application.yml template to override these /opt/restinterface paths, and have a task to initialize all the directories. This is not a high priority, but hopefully it should be straightforward.

@solaechea
Copy link
Contributor

solaechea commented Feb 5, 2025

@JoelProminic Thank you for confirming.

So, if the provisioners are going to customize the paths, no updates are needed in the REST-Interface, right? Or do you want me to update the paths in the embedded application.yml too? If that's the case, the paths should be aligned to the ones defined here. Right?

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

2 participants