Page MenuHomeVyOS Platform

HTTP-API image management requests don't work
Closed, ResolvedPublicBUG

Description

Testing first on VyOS 1.2.5epa

vyos@vyos# show service https
 api {
     debug
     keys {
         id HTTP-API-ID {
         }
         id MY-HTTP-API-ID {
             key MY-HTTP-API-PLAINTEXT-KEY
         }
     }
 }
 listen-address 192.168.122.127 {
 }

From the requester machine I send

curl -k -X POST -F key=MY-HTTP-API-PLAINTEXT-KEY -Fdata='{"op": "add", "url": "https://downloads.vyos.io/rolling/current/amd64/vyos-rolling-latest.iso"}' https://192.168.122.127/image

And I can see in VyOS it establishes the connection

But I quickly get this message at the requester's console:

{"error": "Start service in configuration mode: set service https api"

I do the same test on VyOS 1.3-rolling-202002280217 and get:

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.14.2</center>
</body>
</html>

I was sometimes getting that same outcome when requesting to Crux.

When trying to delete an image I get the following:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.14.2</center>
</body>
</html>

But nothing is deleted.

If I do the same to Crux

curl -k -X POST -F key=MY-HTTP-API-PLAINTEXT-KEY -Fdata='{"op": "delete", "url": "1.2.4"}' http://192.168.122.127/image

I get again

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

But again nothing is deleted.

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.2.5epa1, VyOS 1.3 Rolling
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

Unknown Object (User) created this task.Mar 3 2020, 12:13 PM
Unknown Object (User) renamed this task from HTTP-API image management requests don't seem to work to HTTP-API image management requests don't work.Mar 3 2020, 12:15 PM

Checked on vyos-1.2.5-epa1:

The "301 Moved Permanently" is a result of using an http://x.x.x.x address instead of https://. However, 'curl -L ...' does not resolve correctly, which I will look into.
I did hit the 'Gateway Time-out' once in initial tests; will investigate.
The error "Start service in configuration mode: set service https api" does occur, despite successfully adding the image; this, I presume is due to the process not exiting cleanly; will check.

jestabro changed the task status from Open to In progress.Mar 3 2020, 3:53 PM

The time-out issue is resolved in T2252; other issues as summarized above.