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

Unable to create a volume with a backup plan (leads to internal server error) #356

Open
mrndev opened this issue Sep 5, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mrndev
Copy link

mrndev commented Sep 5, 2023

Description

Creating a volume with backup plan fails

ionosctl volume create \
--ssh-key-paths /home/mnylund/.ssh/id_rsa.pub \
--user-data I2Nsb3VkLWNvbmZpZwoKaG9zdG5hbWU6IEJhY2t1cHRlc3QKCg== \
--datacenter-id 5d24749d-02ee-4d0d-9f87-caa0b6afa11b \
--name Backuptest \
--image-alias ubuntu:22.04 \
--type 'SSD Premium' \
--size 80GB \
--password XXXXX \
--backupunit-id 9d0cecc0-eb02-4e83-8ce9-b1aece8321d2 -w

leads to

Error: 500 Internal Server Error {
  "httpStatus" : 500,
  "messages" : [ {
    "errorCode" : "301",
    "message" : "Oops! Something went very wrong. Please contact the administrator"
  } ]

The backup unit does exist

ionosctl backupunit list
BackupUnitId                           Name                  Email                     State
9d0cecc0-eb02-4e83-8ce9-b1aece8321d2   BackupTestServerTmp   xxemailxx   AVAILABLE

am I missing something? The same command works ok without the backup plan option.

Expected behavior

A volume is created with the backup

Environment

ionosctl --version
ionosctl version v6.6.8

How to Reproduce

Use command above. If you leave out the --backupunit-id , the command succeeds

@mrndev mrndev added the bug Something isn't working label Sep 5, 2023
@avirtopeanu-ionos
Copy link
Contributor

avirtopeanu-ionos commented Sep 5, 2023

I can get the error too, % i volume create --datacenter-id <ID> --backupunit-id <ID>

running with IONOS_LOG_LEVEL=trace shows that request is sent as

{"properties":{"availabilityZone":"AUTO","backupunitId":"<ID>","bus":"VIRTIO","licenceType":"LINUX","name":"Unnamed Volume","size":10,"type":"HDD"}}

I'm in the process of working out if this request is malformed or not, but looking at API docs I don't see the problem - in any case the API shouldn't return a 500

@mrndev
Copy link
Author

mrndev commented Sep 5, 2023

here is the trace if it helps

+ IONOS_LOG_LEVEL=trace
+ ionosctl volume create --ssh-key-paths /home/mnylund/.ssh/id_rsa.pub --user-data I2Nsb3VkLWNvbmZpZwoKaG9zdG5hbWU6IEJhY2t1cHRlc3QKCg== --datacenter-id 5d24749d-02ee-4d0d-9f87-caa0b6afa11b --name Backuptest --image-alias ubuntu:22.04 --type 'SSD Premium' --size 80GB --password XXXX--backupunit-id 9d0cecc0-eb02-4e83-8ce9-b1aece8321d2 -w
IONOSLOG 2023/09/05 08:36:28  DumpRequestOut : POST /cloudapi/v6/datacenters/5d24749d-02ee-4d0d-9f87-caa0b6afa11b/volumes?depth=0&pretty=true HTTP/1.1
Host: api.ionos.com
User-Agent: ionosctl/v6.6.8_ionos-cloud-sdk-go/v6.1.8
Content-Length: 853
Accept: application/json
Authorization:XXXX
Content-Type: application/json
Accept-Encoding: gzip

{"properties":{"availabilityZone":"AUTO","backupunitId":"9d0cecc0-eb02-4e83-8ce9-b1aece8321d2","bus":"VIRTIO","imageAlias":"ubuntu:22.04","imagePassword":"XXXX","name":"Backuptest","size":80,"sshKeys":["ssh-rsa xxxxxxx"],"type":"SSD Premium","userData":"I2Nsb3VkLWNvbmZpZwoKaG9zdG5hbWU6IEJhY2t1cHRlc3QKCg=="}}

IONOSLOG 2023/09/05 08:36:28
 try no: 1
IONOSLOG 2023/09/05 08:36:28
 DumpResponse : HTTP/2.0 500 Internal Server Error
Content-Length: 160
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: *
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: *
Content-Type: application/json
Date: Tue, 05 Sep 2023 08:36:28 GMT
Server: nginx
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Origin
X-Frame-Options: SAMEORIGIN

{
  "httpStatus" : 500,
  "messages" : [ {
    "errorCode" : "301",
    "message" : "Oops! Something went very wrong. Please contact the administrator"
  } ]
}

Error: 500 Internal Server Error {
  "httpStatus" : 500,
  "messages" : [ {
    "errorCode" : "301",
    "message" : "Oops! Something went very wrong. Please contact the administrator"
  } ]
}

@avirtopeanu-ionos
Copy link
Contributor

avirtopeanu-ionos commented Sep 5, 2023

hi, I could create a volume if providing an image-id to a HDD image in same location as the datacenter, and password: i volume create --datacenter-id <...> --backupunit-id <...> --image-id e84aed99-feba-11ed-86e8-2e7f0689c849 --password <...>

looks like a missed validation check both in ionosctl and in the API-side

@mrndev
Copy link
Author

mrndev commented Sep 6, 2023

Yes confirmed, using image-id instead of image-alias. But workaround at its best :)

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

3 participants