Project

General

Profile

Actions

Bug #5435

closed

HTTP 406 Error on Environment or Module Import from Puppet Master

Added by Zach Crownover about 10 years ago. Updated about 10 years ago.

Status:
Duplicate
Priority:
High
Assignee:
-
Category:
Puppet
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Backstory,

I had modules I downloaded from the forge and had them named as their tarballs were in the /etc/puppet/development/modules, initially things like puppetlabs-stdlib-versionsomething, I did a git mv to make them just stdlib and so on, after the puppet master did a git pull, it was no longer able to import environments or modules/classes. Most of the services appear to still be running, it's still reporting and acting as an ENC for what's there, but I can't update modules/classes/environments, or bring in anything new. If I go to Configuration->Environments and click on import from puppet-master-1 then I get the HTTP 406 error. I also get it if I go to Configuration->Puppet Classes and click on import from puppet-master-1.

This is the output from the class section.

Oops, we're sorry but something went wrong

x 406 Not Acceptable

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
RestClient::NotAcceptable
406 Not Acceptable
lib/proxy_api/resource.rb:68:in `get'
lib/proxy_api/puppet.rb:9:in `environments'
app/services/puppet_class_importer.rb:121:in `actual_environments'
app/services/puppet_class_importer.rb:21:in `changes'
app/controllers/concerns/foreman/controller/environments.rb:10:in `import_environments'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

This is the output from the environment section

Oops, we're sorry but something went wrong

x 406 Not Acceptable

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
RestClient::NotAcceptable
406 Not Acceptable
lib/proxy_api/resource.rb:68:in `get'
lib/proxy_api/puppet.rb:9:in `environments'
app/services/puppet_class_importer.rb:121:in `actual_environments'
app/services/puppet_class_importer.rb:21:in `changes'
app/controllers/concerns/foreman/controller/environments.rb:10:in `import_environments'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

Actions #1

Updated by Dominic Cleal about 10 years ago

  • Project changed from Foreman to Smart Proxy
  • Category set to Puppet

The error is coming from the proxy service, so check /var/log/foreman-proxy/proxy.log for more information. It should show the error in its logs.

Actions #2

Updated by Dominic Cleal about 10 years ago

  • Status changed from New to Need more information
Actions #3

Updated by Zach Crownover about 10 years ago

This is what shows up in /var/log/foreman-proxy/proxy.log

I, [2014-04-25T19:08:14.330708 #16257] INFO -- : Initializing from Puppet config file: /etc/puppet/puppet.conf
E, [2014-04-25T19:08:14.350135 #16257] ERROR -- : Failed to list puppet environments: undefined method `[]' for nil:NilClass

Also, this is a VMware VM,with 4GB RAM running CentOS 6.5 with 1 .

This is the contents of my /etc/puppet/puppet.conf with the domain removed for privacy reasons.

################################################################################
  1. This file is managed by Puppet, any changes to it will be overwritten at ###
  2. next system check-in. If changes need to be made, please consult your ###
  3. local sysadmin for them to be done. ### ################################################################################

[main] # The Puppet log directory. # The default value is '$vardir/log'.
logdir = /var/log/puppet

  1. Where Puppet PID files are kept.
  2. The default value is '$vardir/run'.
    rundir = /var/run/puppet
  1. Where SSL certificates are kept.
  2. The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl
  1. Allow services in the 'puppet' group to access key (Foreman + proxy)
    privatekeydir = $ssldir/private_keys { group = service }
    hostprivkey = $privatekeydir/$certname.pem { mode = 640 }
  1. Puppet 3.0.x requires this in both [main] and [master] - harmless on agents
    autosign = $confdir/autosign.conf { mode = 664 }
pluginsync = true

[agent] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` # option. # The default value is '$confdir/classes.txt'.
classfile = $vardir/classes.txt

  1. Where puppetd caches the local configuration. An
  2. extension indicating the cache format is added automatically.
  3. The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig
  1. Disable the default schedules as they cause continual skipped
  2. resources to be displayed in Foreman - only for Puppet >= 3.4
    default_schedules = false
report        = true
pluginsync = true
masterport = 8140
environment = production
certname = puppet-master-1.example.com
server = puppet-master-1.example.com
listen = false
splay = false
runinterval = 1800
noop = false
show_diff = false
configtimeout = 120

[master]
autosign = $confdir/autosign.conf { mode = 664 }
reports = foreman
external_nodes = /etc/puppet/node.rb
node_terminus = exec
ca = true
ssldir = /var/lib/puppet/ssl

[development]
modulepath = /etc/puppet/environments/development/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
config_version =
[production]
modulepath = /etc/puppet/environments/production/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
config_version =

Please let me know if you need other information.

Actions #4

Updated by Zach Crownover about 10 years ago

I'm sorry, I should've used the pre tag.

################################################################################
### This file is managed by Puppet, any changes to it will be overwritten at ###
### next system check-in. If changes need to be made, please consult your    ###
### local sysadmin for them to be done.                                      ###
################################################################################

[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

    # Allow services in the 'puppet' group to access key (Foreman + proxy)
    privatekeydir = $ssldir/private_keys { group = service }
    hostprivkey = $privatekeydir/$certname.pem { mode = 640 }

    # Puppet 3.0.x requires this in both [main] and [master] - harmless on agents
    autosign       = $confdir/autosign.conf { mode = 664 }

    pluginsync = true

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig

    # Disable the default schedules as they cause continual skipped
    # resources to be displayed in Foreman - only for Puppet >= 3.4
    default_schedules = false

    report        = true
    pluginsync    = true
    masterport    = 8140
    environment   = production
    certname      = puppet-master-1.example.com
    server        = puppet-master-1.example.com
    listen        = false
    splay         = false
    runinterval   = 1800
    noop          = false
    show_diff     = false
    configtimeout = 120

[master]
    autosign       = $confdir/autosign.conf { mode = 664 }
    reports        = foreman
    external_nodes = /etc/puppet/node.rb
    node_terminus  = exec
    ca             = true
    ssldir         = /var/lib/puppet/ssl

[development]
    modulepath     = /etc/puppet/environments/development/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
    config_version =
[production]
    modulepath     = /etc/puppet/environments/production/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
    config_version =
Actions #5

Updated by Dominic Cleal about 10 years ago

Which version of Puppet is installed?

Actions #6

Updated by Zach Crownover about 10 years ago

$ facter -p
architecture => x86_64
augeasversion => 1.0.0
blockdevice_sda_model => Virtual disk
blockdevice_sda_size => 32212254720
blockdevice_sda_vendor => VMware
blockdevice_sdb_model => Virtual disk
blockdevice_sdb_size => 32212254720
blockdevice_sdb_vendor => VMware
blockdevice_sr0_model => VMware IDE CDR10
blockdevice_sr0_size => 1073741312
blockdevice_sr0_vendor => NECVMWar
blockdevices => sda,sdb,sr0
domain => aristanetworks.com
facterversion => 2.0.1
filesystems => ext4,iso9660
fqdn => puppet-master-1.example.com
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => puppet-master-1
id => zcrownover
interfaces => eth0,lo,virbr0,virbr0_nic
ipaddress => 172.22.22.231
ipaddress6 => fd7a:629f:52a4:1616:250:56ff:fe95:72d2
ipaddress_eth0 => 172.22.22.231
ipaddress_lo => 127.0.0.1
ipaddress_virbr0 => 192.168.122.1
is_virtual => true
kernel => Linux
kernelmajversion => 2.6
kernelrelease => 2.6.32-431.11.2.el6.x86_64
kernelversion => 2.6.32
macaddress => 00:50:56:95:72:D2
macaddress_eth0 => 00:50:56:95:72:D2
macaddress_virbr0 => 52:54:00:19:8F:D9
macaddress_virbr0_nic => 52:54:00:19:8F:D9
memoryfree => 1.40 GB
memoryfree_mb => 1438.21
memorysize => 3.74 GB
memorysize_mb => 3832.86
mtu_eth0 => 1500
mtu_lo => 16436
mtu_virbr0 => 1500
mtu_virbr0_nic => 1500
netmask => 255.255.255.0
netmask_eth0 => 255.255.255.0
netmask_lo => 255.0.0.0
netmask_virbr0 => 255.255.255.0
network_eth0 => 172.22.22.0
network_lo => 127.0.0.0
network_virbr0 => 192.168.122.0
operatingsystem => CentOS
operatingsystemmajrelease => 6
operatingsystemrelease => 6.5
osfamily => RedHat
path => /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/zcrownover/bin
physicalprocessorcount => 1
processor0 => Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
processorcount => 1
ps => ps -ef
puppetversion => 3.5.1
rubysitedir => /usr/lib/ruby/site_ruby/1.8
rubyversion => 1.8.7
selinux => true
selinux_config_mode => enforcing
selinux_config_policy => targeted
selinux_current_mode => enforcing
selinux_enforced => true
selinux_policyversion => 24
sshdsakey => AAAAB3NzaC1kc3MAAACBAI5pjlwp8/+OEHmFhEbcJLQ+iFcRsH2bgeKRk+JLQo5Txtlur4bJVSE+6ve66Gtm1vQ4D2ee5USxHznCPsbODFykWPbmqoyB/VG44wXe7KJi2v2EQX1Z2nDmE4Gk8DtcTmAZ+GJqkdO0uuXAfPMUr88psIcHexzKrGowxKqBc651AAAAFQCSp/Cs2ylRO9UgtmUlauSSDG8p1wAAAIBJi1ydfA0ls/4XViO3El8H+BZkvCGE1Buwbdx7Haaztx534/1mrzmUOLN5R3aQxZeajFcTdXpOgNIYghlNUXM6e6CG6SV/ZGbWvf/M4uUvbTM6Yc9T4YlKzjHpd57aecxDOaiKp+W4i8Fs1hKAHBIWG3oJFq02c8XO1BDsRcTHPwAAAIB/HHnSaCZ4TciO2fDUVHixU1oQzF2G/mIvVE1fzPLngJ/BIcxySqy+5ebojfNjFsMkE6dIj1cfI0Gyv20TMFg5U+G2mqjEwErzPrJB7tNXtP1gqXi6gpoh1sNmCLvaC9pJRf08KgGoB0dmDFKpH6hv8mmrRdVV38mOk+Q+Watb7Q==
sshfp_dsa => SSHFP 2 1 a1f362eacbee56c260fe8866ca24cb06c4bf45f9
SSHFP 2 2 0135175012e7119c757b8df5ad8f11ea5c41debaa56b6903a86d4d7d1f458273
sshfp_rsa => SSHFP 1 1 85d9f93f250a169d2f76b64217eb89a228ce9161
SSHFP 1 2 ef0492e076207ec29fded836ada1822943918b8c8eacfbd1c5e22927daf2d98d
sshrsakey => AAAAB3NzaC1yc2EAAAABIwAAAQEAzQel5xmEk8HL7+YY3Q2mR15Zs7+WUqLpznzTSEp4PVz0VCLKon3nVTZQIdg301KI7RtN0bua1x1Ax0pzKRWO/i1IfxsK0JVIleUEjk7w2ySvz/kbhtZREtaFA89LxX2tHphl9OxgbaD+RXKJ4lK3oSRuh4xxXcgqBa/KgzEcSnH9xCXN/nXPVyoEeirzF6HKe8bmjdIzPOayWNC5TDIrUikzMgJSQzFvT/bql7ezpQq/e9YTdoW3FuWJ69VdtHCYUf1/1WP2+dMrg0PIIghAWMeedqLlnhFziL3ZCmbsmYixDJ1vjgM58TOHKt8ObioCgDths7bVHfieaPkwQVACyw==
swapfree => 3.87 GB
swapfree_mb => 3967.99
swapsize => 3.87 GB
swapsize_mb => 3967.99
timezone => UTC
uniqueid => 16ace716
uptime => 5 days
uptime_days => 5
uptime_hours => 139
uptime_seconds => 501828
virtual => vmware

Actions #7

Updated by Dominic Cleal about 10 years ago

  • Status changed from Need more information to Duplicate

Ah okay, this is an incompatibility between Smart Proxy 1.3.x and Puppet 3.5.1, see bug #4658. For 3.5.1 compatibility, you'll need to use Smart Proxy 1.4.2 or higher. This would be compatible with Foreman 1.3.x if you only want to upgrade this component.

http://theforeman.org/manuals/1.4/index.html#3.1.2PuppetCompatibility has more compatibility information.

Actions

Also available in: Atom PDF