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

POST to /api/scripts/direct does not work. #1943

Closed
Besangelo opened this issue Sep 30, 2021 · 6 comments
Closed

POST to /api/scripts/direct does not work. #1943

Besangelo opened this issue Sep 30, 2021 · 6 comments
Assignees
Labels
bug Something likely wrong in the code importance: medium A bit annoying, minor miscalculation, but no crash state: confirmed A developer can reproduce the issue
Milestone

Comments

@Besangelo
Copy link

Expected Behaviour

I'm trying to send command to Stellarium via the RemoteContol plugin from a .NET application, using "ScriptService operations (/api/scripts/)" POST direct operation.
The command I'm using to try this is "core.quitStellarium();" (just to have a simple command without any parameter).
I'm expeting Stellarium to execute the command and quit (or do whatever else I put in the command).

Actual Behaviour

Nothing happens, the command seems to be ignored.

Most interesting thing (and probably really relevant) I find the following lines in the Stellarium\Log.txt everytime I try to POST to /api/scripts/direct
QMetaObject::invokeMethod: No such method StelScriptMgr::runScriptDirect(QString,QString)
Candidates are:
runScriptDirect(QString,QString,int&,QString)
runScriptDirect(QString,QString,int&)

This is the HTTP Post data, captured with Wireshark:
0000 50 4f 53 54 20 2f 61 70 69 2f 73 63 72 69 70 74 - POST /api/script
0010 73 2f 64 69 72 65 63 74 20 48 54 54 50 2f 31 2e - s/direct HTTP/1.
0020 31 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a - 1..Content-Type:
0030 20 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d 77 - application/x-w
0040 77 77 2d 66 6f 72 6d 2d 75 72 6c 65 6e 63 6f 64 - ww-form-urlencod
0050 65 64 0d 0a 48 6f 73 74 3a 20 31 39 32 2e 31 36 - ed..Host: 192.16
0060 38 2e 34 2e 31 33 3a 38 30 39 30 0d 0a 43 6f 6e - 8.4.13:8090..Con
0070 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 33 33 0d - tent-Length: 33.
0080 0a 45 78 70 65 63 74 3a 20 31 30 30 2d 63 6f 6e - .Expect: 100-con
0090 74 69 6e 75 65 0d 0a 43 6f 6e 6e 65 63 74 69 6f - tinue..Connectio
00a0 6e 3a 20 4b 65 65 70 2d 41 6c 69 76 65 0d 0a 0d - n: Keep-Alive...
00b0 0a 63 6f 64 65 3d 63 6f 72 65 2e 71 75 69 74 53 - .code=core.quitS
00c0 74 65 6c 6c 61 72 69 75 6d 25 32 38 25 32 39 25 - tellarium%28%29%
00d0 33 42 .. .. .. .. .. .. .. .. .. .. .. .. .. .. - 3B

This packet is created & sent by the HttpClient .NET class which works fine for all other commands.
It seems ok to me.
At the moment, I've worked around this problem by writing the command to a temporary script (.ssc) and running the script.

System

  • Stellarium version: stellarium-0.21.1-win64.exe
  • Operating system: Windows 7
  • Graphics Card: Intel, integrated video, driver version 8.15.10.2622
@github-actions
Copy link

Thanks for adding your first issue to Stellarium. If you have questions, please do not hesitate to contact us.

@alex-w alex-w added the state: grading The problem is in process of classification... label Sep 30, 2021
@gzotti gzotti self-assigned this Sep 30, 2021
@gzotti gzotti added state: confirmed A developer can reproduce the issue importance: medium A bit annoying, minor miscalculation, but no crash and removed state: grading The problem is in process of classification... labels Sep 30, 2021
@gzotti gzotti added this to the 0.21.3 milestone Sep 30, 2021
@github-actions
Copy link

Hello @Besangelo! OK, developers can reproduce the issue. Thanks for the report!

@alex-w alex-w added the bug Something likely wrong in the code label Sep 30, 2021
@gzotti
Copy link
Member

gzotti commented Sep 30, 2021

Some scripting extension works in April 2020 caused this...

@gzotti gzotti closed this as completed in d59dbb7 Oct 1, 2021
@gzotti
Copy link
Member

gzotti commented Oct 1, 2021

This works again:

curl --data 'code=core.quitStellarium();' http://localhost:8090/api/scripts/direct

@github-actions
Copy link

github-actions bot commented Oct 3, 2021

Hello @Besangelo! Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@github-actions
Copy link

Hello @Besangelo! Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something likely wrong in the code importance: medium A bit annoying, minor miscalculation, but no crash state: confirmed A developer can reproduce the issue
Development

No branches or pull requests

3 participants