JonasProgrammer / docker-machine-driver-hetzner

Docker machine driver for the new hetzner cloud API
https://jonasprogrammer.github.io/docker-machine-driver-hetzner/
MIT License
434 stars 54 forks source link

Error in docker-machine create Command with Hetzner Driver: "invalid input in fields 'firewalls', 'networks'" #126

Closed Qanah closed 2 weeks ago

Qanah commented 2 weeks ago

Description: I encountered an error while using docker-machine-driver-hetzner to create a Docker machine on Hetzner. The command worked successfully on January 9th, 2024, but now it fails with an error regarding "invalid input in fields 'firewalls', 'networks'".

Command Used:

docker-machine create \
  --driver hetzner \
  --hetzner-api-token=$HETZNER_API_TOKEN \
  --hetzner-server-type=$HETZNER_SERVER_TYPE \
  --hetzner-server-location=$HETZNER_SERVER_LOCATION \
  --hetzner-image=$HETZNER_IMAGE \
  --hetzner-networks=$HETZNER_NETWORKS \
  --hetzner-firewalls=$HETZNER_FIREWALLS \
  $SERVER_NAME

Error Message:

Running pre-create checks...
Creating machine...
(elasticsearch-8) Creating SSH key...
(elasticsearch-8) SSH key not found in Hetzner. Uploading...
(elasticsearch-8) Creating Hetzner server...
Error creating machine: Error in driver during machine creation: could not create server: invalid input in fields 'firewalls', 'networks' (invalid_input)

Steps to Reproduce:

Run the docker-machine create command with the parameters as listed above.
Observe the error output.

Expected Behavior: The Docker machine should be created without issues, as it did previously.

Environment:

Operating System: macOS with Apple Silicon (arm64)
Docker Version: Docker version 27.0.3, build 7d4bcd8
Driver Version: docker-machine-driver-hetzner Version: 5.0.2

Additional Information: This command worked successfully on January 9th, 2024, without any modifications. I am sure that the $HETZNER_NETWORKS and $HETZNER_FIREWALLS are correct values, and they were tested before.

Qanah commented 2 weeks ago

Thank you for looking into this! I discovered that the issue was actually due to my bash script configuration, not the driver itself. Running the command directly works perfectly. I apologize for any confusion and for taking up your time with this. Closing the issue now.

Thank you again for your support and for this helpful project!

Qanah commented 2 weeks ago

fixed by change env $HETZNER_NETWORKS to $HETZNER_NETWORK_ID and HETZNER_FIREWALLS to HETZNER_FIREWALL_ID