Project

General

Profile

Actions

Bug #10723

closed

Unable to save changes in Foreman 1.8.1 (https://puppet.cptaq.local/hosts/test1.openstacklocal/edit)

Added by Claude Durocher over 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I'm trying to edit a host (add a class to it) but my changes are not saved. In production.log I have this

2015-06-05 18:17:30 [I] Started POST "/puppetclasses/197/parameters" for 10.17.74.53 at 2015-06-05 18:17:30 -0400
2015-06-05 18:17:30 [I] Processing by PuppetclassesController#parameters as */*
2015-06-05 18:17:30 [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"Fdmm1+p9edpfdC2rhW1rirY8U1oV3vQnHHVLKDdmwUs=", "host"=>{"name"=>"test1.openstacklocal", "hostgroup_id"=>"", "environment_id"=>"1", "puppet_ca_proxy_id"=>"2", "puppet_proxy_id"=>"2", "puppetclass_ids"=>["", "197"], "managed"=>"f", "progress_report_id"=>"[FILTERED]", "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"5", "comment"=>"", "overwrite"=>"false"}, "host_id"=>"34", "id"=>"197"}
2015-06-05 18:17:30 [I]   Rendered puppetclasses/_class_parameters.html.erb (14.1ms)
2015-06-05 18:17:30 [I] Completed 200 OK in 27.1ms (Views: 12.3ms | ActiveRecord: 4.9ms)
2015-06-05 18:17:33 [I] Started PUT "/hosts/test1.openstacklocal" for 10.17.74.53 at 2015-06-05 18:17:33 -0400
2015-06-05 18:17:33 [I] Processing by HostsController#update as */*
2015-06-05 18:17:33 [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"Fdmm1+p9edpfdC2rhW1rirY8U1oV3vQnHHVLKDdmwUs=", "host"=>{"name"=>"test1.openstacklocal", "hostgroup_id"=>"", "environment_id"=>"1", "puppet_ca_proxy_id"=>"2", "puppet_proxy_id"=>"2", "puppetclass_ids"=>["", "197"], "managed"=>"f", "progress_report_id"=>"[FILTERED]", "is_owned_by"=>"3-Users", "enabled"=>"1", "model_id"=>"5", "comment"=>"", "overwrite"=>"false"}, "id"=>"test1.openstacklocal"}
2015-06-05 18:17:33 [I] Failed to save: Interfaces some interfaces are invalid
2015-06-05 18:17:33 [I]   Rendered hosts/_progress.html.erb (0.2ms)
2015-06-05 18:17:33 [I]   Rendered puppetclasses/_selectedClasses.html.erb (1.3ms)
2015-06-05 18:17:33 [I]   Rendered puppetclasses/_classes_in_groups.html.erb (0.0ms)
2015-06-05 18:17:33 [I]   Rendered puppetclasses/_classes.html.erb (481.1ms)
2015-06-05 18:17:33 [I]   Rendered puppetclasses/_class_selection.html.erb (497.1ms)
2015-06-05 18:17:33 [I]   Rendered puppetclasses/_class_parameters.html.erb (0.0ms)
2015-06-05 18:17:33 [I]   Rendered puppetclasses/_classes_parameters.html.erb (6.5ms)
2015-06-05 18:17:33 [I]   Rendered common_parameters/_inherited_parameters.html.erb (0.2ms)
2015-06-05 18:17:33 [I]   Rendered common_parameters/_puppetclass_parameter.html.erb (1.9ms)
2015-06-05 18:17:33 [I]   Rendered common_parameters/_puppetclasses_parameters.html.erb (3.7ms)
2015-06-05 18:17:33 [I]   Rendered common_parameters/_parameter.html.erb (1.1ms)
2015-06-05 18:17:33 [I]   Rendered common_parameters/_parameters.html.erb (2.6ms)
2015-06-05 18:17:33 [I]   Rendered hosts/_form.html.erb (540.1ms)
2015-06-05 18:17:33 [I]   Rendered hosts/edit.html.erb within layouts/application (542.1ms)
2015-06-05 18:17:33 [I]   Rendered home/_user_dropdown.html.erb (1.1ms)
2015-06-05 18:17:33 [I] Read fragment views/tabs_and_title_records-3 0.1ms
2015-06-05 18:17:33 [I]   Rendered home/_topbar.html.erb (1.8ms)
2015-06-05 18:17:33 [I]   Rendered layouts/base.html.erb (3.0ms)
2015-06-05 18:17:33 [I] Completed 200 OK in 630.9ms (Views: 538.9ms | ActiveRecord: 23.6ms)
2015-06-05 18:17:34 [I] Started GET "/tasks/95fa6955-8c71-4879-95f1-1b697f8e38e7" for 10.17.74.53 at 2015-06-05 18:17:34 -0400
2015-06-05 18:17:34 [I] Processing by TasksController#show as */*
2015-06-05 18:17:34 [I]   Parameters: {"id"=>"95fa6955-8c71-4879-95f1-1b697f8e38e7"}
2015-06-05 18:17:34 [I]   Rendered tasks/_list.html.erb (0.2ms)
2015-06-05 18:17:34 [I] Completed 200 OK in 4.1ms (Views: 0.8ms | ActiveRecord: 0.5ms)

In fact, any changes to the host are lost. No errors is displayed in the UI.

Running Foreman on Ubuntu 14.04.


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #10260: Allow interfaces management for unmanaged hostsClosedMarek Hulán04/24/2015Actions
Actions #1

Updated by Marek Hulán over 9 years ago

I suppose this is unmanaged host. You should be able to fix interfaces using our API. In 1.8.2 you should be able to fix it from WebUI as well thanks to #10260.

Actions #2

Updated by Marek Hulán over 9 years ago

  • Related to Feature #10260: Allow interfaces management for unmanaged hosts added
Actions #3

Updated by Claude Durocher over 9 years ago

It's unmanaged hosts. How come I did not hit this bug in earlier 1.8 releases (rc and 1.8.0)?

Also the api seems broken :

root@puppet:~# curl -k -u admin:*** -H "Content-Type:application/json" -H "Accept:application/json"  https://puppet.cptaq.local/api/hosts/test1.openstacklocal|prettify_json.rb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1597    0  1597    0     0  19294      0 --:--:-- --:--:-- --:--:-- 19475
{
  "host": {
    "name": "test1.openstacklocal",
    "id": 34,
    "ip": "192.168.111.34",
    "environment_id": 1,
    "last_report": "2015-06-05T22:10:41Z",
    "updated_at": "2015-06-05T22:10:46Z",
    "created_at": "2015-06-05T20:56:12Z",
    "mac": "fa:16:3e:95:36:af",
    "sp_mac": null,
    "sp_ip": null,
    "sp_name": null,
    "domain_id": 3,
    "architecture_id": 1,
    "operatingsystem_id": 1,
    "subnet_id": null,
    "sp_subnet_id": null,
    "ptable_id": null,
    "medium_id": null,
    "build": false,
    "comment": null,
    "disk": null,
    "installed_at": null,
    "model_id": 5,
    "hostgroup_id": null,
    "owner_id": null,
    "owner_type": null,
    "enabled": true,
    "puppet_ca_proxy_id": 2,
    "managed": false,
    "use_image": null,
    "image_file": "",
    "uuid": null,
    "compute_resource_id": null,
    "puppet_proxy_id": 2,
    "certname": "test1.openstacklocal",
    "image_id": null,
    "last_compile": "2015-06-05T22:10:45Z",
    "last_freshcheck": null,
    "serial": null,
    "source_file_id": null,
    "puppet_status": 0,
    "root_pass": null,
    "parameters": [

    ],
    "environment": {
      "environment": {
        "id": 1,
        "name": "production" 
      }
    },
    "interfaces": [
      {
        "id": 58,
        "ip": "192.168.111.34",
        "mac": "fa:16:3e:95:36:af",
        "attrs": {
          "network": "192.168.111.0",
          "netmask": "255.255.255.0",
          "mtu": "1500" 
        },
        "name": "test1.openstacklocal",
        "type": "Nic::Managed",
        "username": null,
        "password": null,
        "provider": null,
        "subnet_id": null,
        "domain_id": 3,
        "created_at": "2015-06-05T20:56:12Z",
        "updated_at": "2015-06-05T20:56:13Z" 
      },
      {
        "id": 61,
        "ip": "192.168.111.37",
        "mac": "fa:16:3e:c1:b6:e0",
        "attrs": {
          "network": "192.168.111.0",
          "netmask": "255.255.255.0",
          "mtu": "1500" 
        },
        "name": null,
        "type": "Nic::Managed",
        "username": null,
        "password": null,
        "provider": null,
        "subnet_id": null,
        "domain_id": null,
        "created_at": "2015-06-05T21:13:37Z",
        "updated_at": "2015-06-05T22:10:46Z" 
      }
    ]
  }
}
root@puppet:~# curl -k -u admin:*** -H "Content-Type:application/json" -H "Accept:application/json"  https://puppet.cptaq.local/api/hosts/test1.openstacklocal/interfaces | prettify_json.rb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   728  100   728    0     0  18501      0 --:--:-- --:--:-- --:--:-- 18666
/usr/lib/ruby/vendor_ruby/json/common.rb:155:in `parse': 757: unexpected token at '<!DOCTYPE html> (JSON::ParserError)
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <h1>The page you were looking for doesn't exist.</h1>
    <p>You may have mistyped the address or the page may have moved.</p>
  </div>
</body>
</html>
'
    from /usr/lib/ruby/vendor_ruby/json/common.rb:155:in `parse'
    from /var/lib/gems/1.9.1/gems/json-utils-1.6.1/bin/prettify_json.rb:35:in `<top (required)>'
    from /usr/local/bin/prettify_json.rb:23:in `load'
    from /usr/local/bin/prettify_json.rb:23:in `<main>'
Actions #4

Updated by Claude Durocher over 9 years ago

In api v2, it works fine however:

root@puppet:~# curl -k -u admin:*** -H "Content-Type:application/json" -H "Accept:application/json"  https://puppet.cptaq.local/api/v2/hosts/test1.openstacklocal/interfaces|prettify_json.rb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   812    0   812    0     0   3703      0 --:--:-- --:--:-- --:--:--  3707
{
  "total": 2,
  "subtotal": 2,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "subnet_id": null,
      "subnet_name": null,
      "domain_id": 3,
      "domain_name": "openstacklocal",
      "created_at": "2015-06-05T20:56:12Z",
      "updated_at": "2015-06-05T20:56:13Z",
      "managed": true,
      "identifier": "eth0",
      "id": 58,
      "name": "test1.openstacklocal",
      "ip": "192.168.111.34",
      "mac": "fa:16:3e:95:36:af",
      "primary": true,
      "provision": true,
      "type": "interface",
      "virtual": false
    },
    {
      "subnet_id": null,
      "subnet_name": null,
      "domain_id": null,
      "domain_name": null,
      "created_at": "2015-06-05T21:13:37Z",
      "updated_at": "2015-06-05T22:10:46Z",
      "managed": false,
      "identifier": "eth0",
      "id": 61,
      "name": null,
      "ip": "192.168.111.37",
      "mac": "fa:16:3e:c1:b6:e0",
      "primary": false,
      "provision": false,
      "type": "interface",
      "virtual": false
    }
  ]
}
Actions #5

Updated by Claude Durocher over 9 years ago

Ok, now i have a better understanding of what's happening : the host with problems have two interfaces associated. This is due to the fact I'm destroying the VMs in Openstack and then recreating them without deleting them in Foreman (I only delete the certificate). So Foreman adds a new interface to the host if the IP has changed wich is the case here. Simply deleting the old interface with the api solves the problem and I can afterwards sucessfuly edit the host.

Actions #6

Updated by Marek Hulán over 9 years ago

  • Status changed from New to Need more information

Could you verify that you can delete additional interfaces through WebUI in Foreman 1.8.2? I think that the behaviour you've described is actually correct, you just didn't see any interface (unmanaged) host which was really confusing. 1.8.2 should allow interface management for unmanaged hosts thanks to #10260

Actions #7

Updated by Claude Durocher over 9 years ago

In 1.8.2, I can see the interfaces but I can't delete them (got somme error message in the gui, can't remeber exactly as I'm not in front of the console). Deletion with the cli always work however.

Actions #8

Updated by Tomer Brisker over 8 years ago

  • Status changed from Need more information to Resolved

If I understand correctly, this should work correctly in current versions.
Closing, please reopen if problem still exists today with steps to reproduce.

Actions

Also available in: Atom PDF