Bug #5883
closedHost: provide user indication that the build token has expired
Description
While setting up a new development environment, I needed to go through a few iterations on the configuration to get it to the point where I could successfully provision a host. During this process, I created a host in the UI and by the time I had everything set to provision the host, the build token had expired. This led to what appeared to be a provisioning loop. In the production log, there was a 404 on the 'built' request; however, it wasn't really that obvious what the issue was or how to resolve it.
We may want to consider possible solutions to help users that might encounter this scenario. For example,
1. provide some text or indication in the UI that the build token has expired and that the build should be cancelled & initiated to generate a new token
2. might want to re-consider if 60 minutes is a good default for the token, to minimize the frequency of the timeouts, while still providing the security intended
3+. ...
(Note: I was using bootdisk, so I created the host in foreman and then initiated the vm creation from virt-manager).
The following is an example of the error in the logs:
Rendered /home/bbucking/.rvm/gems/ruby-1.9.3-p448@fortello/gems/actionpack-3.2.18/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.5ms) Processing by UnattendedController#built as */* Parameters: {"token"=>"3d0a0855-db1c-4ee1-8880-6c4a95d4ca18"} ^[[1m^[[35mHost::Managed Load (0.5ms)^[[0m SELECT hosts.* FROM "hosts" INNER JOIN "tokens" ON "tokens"."host_id" = "hosts"."id" WHERE "hosts"."type" IN ('Host::Managed') AND "tokens"."value" = '3d0a0855-db1c-4ee1-8880-6c4a95d4ca18' AND (expires >= '2014-05-22 16:20:01') LIMIT 1 ^[[1m^[[36mHost::Managed Load (0.2ms)^[[0m ^[[1mSELECT "hosts".* FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."ip" = '192.168.122.23' LIMIT 1^[[0m unattended: unable to find a host that matches the request from 192.168.122.23 Filter chain halted as :get_host_details rendered or redirected Completed 404 Not Found in 3.7ms (ActiveRecord: 0.7ms)
Files