Skip to content

scaleway-sdk-go: http error 400 Bad Request: snapshot is not available #39

Closed
@karelorigin

Description

@karelorigin

Overview of the Issue

The Scaleway Packer plugin fails to build an image. This error appears exclusively for block storage SSD images.

Reproduction Steps

  1. Set all the required Scaleway environment variables as documented
  2. Run Packer using:
packer build -var="scw_commercial_type=DEV1-S" -var "image_size_in_gb=50" -var "image_name=foo" foo.pkr.hcl

Plugin and Packer version

From packer version

packer v1.8.1

Plugin version:

v1.0.3

Simplified Packer Buildfile

packer {
  required_plugins {
    scaleway = {
      version = "1.0.3"
      source  = "github.com/hashicorp/scaleway"
    }
  }

  required_version = ">= 1.5.4"
}

# Scaleway image ID or label
variable "scw_image_id" {
  type    = string
  default = "ubuntu_focal"
}

# Scaleway VPS type
variable "scw_commercial_type" {
  type = string
}

# Image name is the resuling image name
variable "image_name" {
  type = string
}

# Volume size in GB, defaults to 0 for a standard local SSD configuration
variable "image_size_in_gb" {
  type    = number
  default = 0
}

source "scaleway" "foo-image" {
  image            = var.scw_image_id
  commercial_type  = var.scw_commercial_type
  image_size_in_gb = var.image_size_in_gb
  ssh_username     = "root"
  image_name       = var.image_name
}

build {
  sources = ["source.scaleway.foo-image"]
}

Operating system and Environment details

Tested on MacOS Catalina (10.15.7)

Log Fragments and crash.log files

scaleway.foo-image: output will be in this color.

==> scaleway.foo-image: Prevalidating image name: foo
==> scaleway.foo-image: Prevalidating snapshot name: snapshot-packer-1657808327
==> scaleway.foo-image: Creating temporary ssh key for server...
==> scaleway.foo-image: Creating server...
==> scaleway.foo-image: Waiting for server to become active...
==> scaleway.foo-image: Using SSH communicator to connect: 51.15.107.16
==> scaleway.foo-image: Waiting for SSH to become available...
==> scaleway.foo-image: Connected to SSH!
==> scaleway.foo-image: Shutting down server...
==> scaleway.foo-image: Creating snapshot: snapshot-packer-1657808327
==> scaleway.foo-image: Creating image: foo
==> scaleway.foo-image: Error creating image: scaleway-sdk-go: http error 400 Bad Request: snapshot is not available
==> scaleway.foo-image: Provisioning step had errors: Running the cleanup provisioner, if present...
==> scaleway.foo-image: Destroying server...
Build 'scaleway.foo-image' errored after 1 minute 6 seconds: Error creating image: scaleway-sdk-go: http error 400 Bad Request: snapshot is not available

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions