scaleway / terraform-provider-scaleway

Terraform Scaleway provider
https://www.terraform.io/docs/providers/scaleway/
Mozilla Public License 2.0
199 stars 123 forks source link

Provider has stopped working #60

Closed shadycuz closed 6 years ago

shadycuz commented 6 years ago

Terraform Version

Terraform v0.11.7
+ provider.scaleway v1.3.0

Affected Resource(s)

data.scaleway_image

Terraform Configuration Files

data "scaleway_image" "ubuntu" {
  architecture = "x86_64"
  name         = "Ubuntu Zesty"
}

data "scaleway_image" "openvpn" {
  architecture = "x86_64"
  name         = "OpenVPN"
}

Debug Output

data.scaleway_image.ubuntu: Refreshing state...
data.scaleway_image.openvpn: Refreshing state...
2018/04/27 15:23:44 [ERROR] root: eval: *terraform.EvalReadDataApply, err: data.scaleway_image.openvpn: The query returned no result. Please refine your query.
2018/04/27 15:23:44 [ERROR] root: eval: *terraform.EvalSequence, err: data.scaleway_image.openvpn: The query returned no result. Please refine your query.
2018/04/27 15:23:44 [ERROR] root: eval: *terraform.EvalReadDataApply, err: data.scaleway_image.ubuntu: The query returned no result. Please refine your query.
2018/04/27 15:23:44 [ERROR] root: eval: *terraform.EvalSequence, err: data.scaleway_image.ubuntu: The query returned no result. Please refine your query.
2018/04/27 15:23:44 [DEBUG] plugin: waiting for all plugin processes to complete...

Error: Error refreshing state: 2 error(s) occurred:

* data.scaleway_image.openvpn: 1 error(s) occurred:

* data.scaleway_image.openvpn: data.scaleway_image.openvpn: The query returned no result. Please refine your query.
* data.scaleway_image.ubuntu: 1 error(s) occurred:

2018-04-27T15:23:44.166-0400 [DEBUG] plugin: plugin process exited: path=/home/ansible/repos/scaleway-kubernetes-infra/.terraform/plugins/linux_amd64/terraform-provider-scaleway_v1.3.0_x4
* data.scaleway_image.ubuntu: data.scaleway_image.ubuntu: The query returned no result. Please refine your query.

Expected Behavior

My 'terraform plan' operation should have completed.

Actual Behavior

Error

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

Important Factoids

This has worked for months and last worked a week or so ago. Now it doesn't work. My token is still valid. I was able to hit the API via curl. Possible they somehow broke the api for the terraform client?

nicolai86 commented 6 years ago

@shadycuz I’m sorry for the inconvenience. As you can see from the terraform plan output, the query for the image returns no data any more.

Did you validate that Ubuntu Zesty is still accessible as a image? Ubuntu Zesty is not a LTS release so I’d expect Scaleway to remove the image once it reaches EOL. EOL was January 13th.

shadycuz commented 6 years ago

@nicolai86

Yes both images are still listed image

Let me test by listing the images via the API with curl.

shadycuz commented 6 years ago

I would have to curl through all the pages.

nicolai86 commented 6 years ago

I’ll take a look. Thanks for the report!

nicolai86 commented 6 years ago

@shadycuz I've confirmed via the API that there is no x86_64 image for OpenVPN at the moment:

x86_64

# curl 'https://api-marketplace.scaleway.com/images?arch=x86_64'  | jq -r '.images[].name'
Debian Jessie
Ubuntu Xenial
Python
Docker
Golang
Gogs
Node.js
ownCloud
Java
Ruby
Fedora 27
CentOS 7.4
Arch Linux
Debian Stretch
Alpine Linux
Ubuntu Mini Xenial 25G

ARM

# curl 'https://api-marketplace.scaleway.com/images?arch=arm'  | jq -r '.images[].name'
Redis
Camlistore
Serendipity
ZeroBin
Ruby on Rails
Etherpad
Discourse
Fedora
openSUSE
Kanboard
Syncthing
Jenkins Master
Pydio
Jenkins Slave
Drupal
Minecraft
Ghost
ELK stack
PrestaShop
Gentoo
Redmine
CentOS 7.2
LEMP stack
Image Builder
Webmin
Ubuntu Precise
Ubuntu Wily
Ubuntu Yakkety
Ubuntu Trusty
GitLab
Debian Sid
Ubuntu Zesty
WordPress
OpenVPN
Torrents
Debian Jessie
Ubuntu Xenial
Python
Docker
Golang
Gogs
Node.js
ownCloud
Java
Debian Wheezy
Ruby
Debian Stretch
nicolai86 commented 6 years ago

~Please check with Scaleway support what happened to the missing image.~ This seems to be related to different API endpoints. Seems like a bug after all:

# curl https://cp-ams1.scaleway.com/images?arch=x86_64 | jq -r '.images[].name'
Alpine Linux
Ubuntu Xenial
Ubuntu Xenial
Alpine Linux
Ubuntu Xenial
Ubuntu Xenial
Alpine Linux
Debian Stretch
Fedora 27
CentOS 7.4
Arch Linux
CentOS 7.4
Fedora 27
Debian Sid/Unstable
Debian Stretch
Node.js LTS 8.x
Debian Wheezy
Java jdk10
Debian Jessie
Debian Jessie
Debian Stretch
Ubuntu Xenial
Debian Jessie
Ubuntu Xenial
Ubuntu Xenial
Docker
Seedbox
GOGS
Privatebin
Golang 1.10
Ubuntu Xenial
Debian Jessie
Arch Linux
ownCloud
Python
Ruby
CentOS 7.3
Torrents 1.4.0
LEMP - Nginx+PHP+MySQL
OpenVPN
OpenVPN
OpenVPN
Wordpress 4.8.0
Ubuntu Zesty (17.04 latest)
Debian Sid/Unstable
Debian Stretch (9.0)
Debian Stretch (9.0)
CentOS 7.3
GitLab
Ubuntu Yakkety (16.10 latest)

# curl https://cp-par1.scaleway.com/images?arch=x86_64 | jq -r '.images[].name'
Ubuntu Xenial
Ubuntu Xenial
Ubuntu Xenial
Alpine Linux
Ubuntu Xenial
Ubuntu Xenial
Ubuntu Xenial
Alpine Linux
Debian Stretch
Alpine Linux
Fedora 27
CentOS 7.4
Arch Linux
CentOS 7.4
Fedora 27
Seedbox
Ruby
Docker
Node.js LTS 8.x
ownCloud
Java jdk10
Privatebin
Python
GOGS
Golang 1.10
Ubuntu Xenial
Debian Stretch
Debian Jessie
Debian Jessie
Debian Jessie
Debian Stretch
Debian Jessie
Arch Linux
Ubuntu Xenial
Ubuntu Xenial
Ubuntu Xenial
Debian Sid/Unstable
Debian Wheezy
CentOS 7.3
Torrents 1.4.0
LEMP - Nginx+PHP+MySQL
OpenVPN
OpenVPN
OpenVPN
Wordpress 4.8.0
Ubuntu Zesty (17.04 latest)
Debian Sid/Unstable
Debian Stretch (9.0)
Debian Stretch (9.0)
CentOS 7.3

# curl https://cp-par1.scaleway.com/images?arch=arm | jq -r '.images[].name'
Debian Stretch
Ruby
Seedbox
Privatebin
ownCloud
Python
Docker
Node.js LTS 8.x
Java jdk10
GOGS
Golang 1.10
Ubuntu Xenial
Debian Jessie
Debian Jessie
Debian Jessie
Debian Stretch
Debian Jessie
Ubuntu Xenial
Ubuntu Xenial
Ubuntu Xenial
Debian Sid/Unstable
Debian Wheezy
Torrents 1.4.0
LEMP - Nginx+PHP+MySQL
OpenVPN
OpenVPN
OpenVPN
Wordpress 4.8.0
Ubuntu Zesty (17.04 latest)
Debian Sid/Unstable
Debian Stretch (9.0)
Debian Stretch (9.0)
GitLab
Ubuntu Xenial (16.04 latest)
Ubuntu Precise (12.04)
Ubuntu Yakkety (16.10 latest)
Ubuntu Wily (15.10)
Ubuntu Trusty (14.04)
Cozy Cloud (beta)
Webmin 1.820
Docker 1.12.2
Image Builder 1.4.3
Ubuntu Yakkety (16.10 latest)
Ubuntu Yakkety (16.10 latest)
Docker 1.12.1
Archlinux
Archlinux
Cozy Cloud
LEMP - Nginx+PHP+MySQL
CentOS 7.2

# curl https://cp-ams1.scaleway.com/images?arch=arm | jq -r '.images[].name'
Debian Stretch
Debian Sid/Unstable
Debian Wheezy
Debian Jessie
Ubuntu Xenial
Debian Jessie
Debian Jessie
Debian Jessie
Ubuntu Xenial
Ubuntu Xenial
Python
Docker
Node.js LTS 8.x
Ruby
Privatebin
Java jdk10
GOGS
Ubuntu Xenial
Debian Stretch
Golang 1.10
Seedbox
ownCloud
Torrents 1.4.0
LEMP - Nginx+PHP+MySQL
OpenVPN
OpenVPN
OpenVPN
Wordpress 4.8.0
Ubuntu Zesty (17.04 latest)
Debian Sid/Unstable
Debian Stretch (9.0)
Debian Stretch (9.0)
GitLab
Ubuntu Wily (15.10)
Ubuntu Yakkety (16.10 latest)
Ubuntu Xenial (16.04 latest)
Ubuntu Precise (12.04)
Ubuntu Trusty (14.04)
Cozy Cloud (beta)
Webmin 1.820
Docker 1.12.2
Archlinux
Archlinux
Cozy Cloud
Docker 1.11.1
Ubuntu Xenial (16.04 latest)
Alpine Linux 3.3
GOGS 0.9.13
Docker 1.10.0
Ubuntu Xenial (16.04 latest)
shadycuz commented 6 years ago

@nicolai86 I opened an issue with Scaleway to see if they could provide any valuable insight.

Thanks for looking at this so closely.

shadycuz commented 6 years ago

Response from scaleway.

My colleague from Terraform is right, we do not have an OpenVPN image for x86_64 right now. This is following the new features that we are deploying (https://blog.online.net/2018/04/19/scaleway-feature-improvements-custom-kernel-security-group-live-reload-imagehub-packer/)

We are reworking all of our images to make them compatible with Local Boot. Rest assured, OpenVPN will come back !

I'm sorry for the inconvenience.

Doesn't really explain the API endpoints that still return the images.

nicolai86 commented 6 years ago

Thank you for reaching out to Scaleway. I’ll leave the issue open for some time; maybe they’ll fix the missing image quickly.

hadret commented 6 years ago

hm, I'm not 100% it's related, but does look very similar to the issue I'm hitting. I'm fetching UUIDs of the images via scw images -f name=ubuntu -q. unfortunately, none appear to be working. I tried Xenial and Bionic and both are responding like so:

* scaleway_server.test: StatusCode: 404, Type: unknown_resource, APIMessage: "3dcbd786-27f9-41c8-887e-cb468a877517" not found

way to reproduce:

  1. fetch the image UUID:
scw images -f name=ubuntu -q
  1. prepare simple terraform plan:
provider "scaleway" {
  region       = "par1"
}

resource "scaleway_server" "test" {
  name       = "test"
  image      = "3dcbd786-27f9-41c8-887e-cb468a877517"
  type       = "C2S"
  tags       = ["test"]
}
  1. fail:
* scaleway_server.test: StatusCode: 404, Type: unknown_resource, APIMessage: "3dcbd786-27f9-41c8-887e-cb468a877517" not found
nicolai86 commented 6 years ago

@hadret do you have a reason for not using the data source to lookup images? Otherwise you need to make sure datacenter & architecture match.

hadret commented 6 years ago

no, I don't. fair point, I will try it out tomorrow and get back here -- on the other hand, these two particular images are super generic and they support all of the architectures for both datacenters.

hadret commented 6 years ago

ok, using data source fixed the issue for me. strange, that the uuid is different though...

remyleone commented 6 years ago

@shadycuz OpenVPN images exist for x86_64. Could you check again if you can instantiate one?

shadycuz commented 6 years ago

@sieben They have added the missing images. This had to do with this https://blog.online.net/2018/04/19/scaleway-feature-improvements-custom-kernel-security-group-live-reload-imagehub-packer/.

Thanks all.