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

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

Closed
karelorigin opened this issue Jul 14, 2022 · 5 comments
Closed
Assignees
Labels

Comments

@karelorigin
Copy link

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
@remyleone
Copy link
Member

Maybe the timeout was a bit too short by default. Basically, the snapshot was not yet done that the image tried to exist. Could you try to relaunch it?

@karelorigin
Copy link
Author

I have tried this various times, same problem @remyleone. Even if that were the case, it shouldn't be that unreliable

@karelorigin
Copy link
Author

Were you able to reproduce it? @remyleone

@remyleone
Copy link
Member

@yfodil

@yfodil
Copy link
Contributor

yfodil commented Aug 4, 2022

Hello @karelorigin, regarding the error you encountered, I was able to reproduce it using the plugin version 1.0.3, this behavior is fixed in the last release (see the PR ad44180).

I suggest you to upgrade your version to 1.0.5. Feel free to comment and reopen the issue if needed.

@yfodil yfodil closed this as completed Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants