Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find node

>
>
> >
> >
> >
> >
> > >
> > >> if that doesn't work, then you can always replace our ENC script with
> the following
> > >>
> > >> #! /bin/sh
> > >>
> > >> curl -ks https://foreman/node/$1?format=yml
> > >>
> > >> Ohad
> > > ----
> > > I dont understand exactly what this means…
> > >
> > > # su - puppet -s /bin/bash
> > > Creating directory '/home/puppet'.
> > > puppet@ubuntu:~$ /etc/puppet/node.rb ubuntu.ttinet
> > >
> > > wrong status line: "<!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML
> 2.0//EN&quot;>"
> > >
> > > as for replacing ENC script, I would presume you are speaking about the
> file that I copied and configured /etc/puppet/node.conf - this works
> > >
> > > def enc
> > > # foreman_url = "#{url}/node/#{certname}?format=yml"
> > > # uri = URI.parse(foreman_url)
> > > # req = Net::HTTP::Get.new(foreman_url)
> > > # res = Net::HTTP.start(uri.host, uri.port) { |http| http.request(req)
> }
> > >
> > > res = system("/usr/bin/curl -k #{url}/node/#{certname}?format=yml")
> > >
> > > # raise "Error retrieving node #{certname}: #{res.class}" unless
> res.code == "200"
> > > # res.body
> > > # res
> > > end
> > ----
> > I spoke too soon - so near but yet so far.
> >
> > The above adjustment works for all 'existing' nodes but if I am adding a
> new node, I expect it to get the default node classes but with this setup,
> if fails with a thud (same error). I cant seem to use 'raise "Error…"
> because that seems to relate to the Net::HTTP class which is what I am
> eliminating above.
> >
> > Foreman does not support a concept of default node, if you want one, you
> can add it into your puppet manifest.
> > but, if you use foreman, then the host would show up, and you could
> assign the classes / hostgroups to it directly.
> ----
> appears that I have fixed it finally - had to get into net/https to figure
> out how it works.
>
> If you want, I could give you a diff or even put it into your bug tracker
> but perhaps this doesn't have application beyond me.
>
> ENC section of 'node.rb'
>
> def enc
> foreman_url = "#{url}/node/#{certname}?format=yml"
> uri = URI.parse(foreman_url)
>
> # original code from foreman/extras/puppet/foreman/files/foreman-node.rb
> # req = Net::HTTP::Get.new(foreman_url)
> # res = Net::HTTP.start(uri.host, uri.port) { |http| http.request(req) }
>
> # changes to allow self-signed certificates without errors
> https = Net::HTTP.new(uri.host, uri.port)
> https.use_ssl = true
> https.verify_mode = OpenSSL::SSL::VERIFY_NONE
> req = Net::HTTP::Get.new(foreman_url)
> res = https.request(req)
>
> # original code base again
> raise "Error retrieving node #{certname}: #{res.class}" unless res.code ==
> "200"
> res.body
> end
>
> Thanks, i guess the error message was simply misleading.

if you can, please open a new issue, and ideally send a patch too :slight_smile:

many thanks,
Ohad

··· On Sat, Aug 13, 2011 at 1:35 AM, Craig White wrote: > On Aug 12, 2011, at 11:50 AM, Ohad Levy wrote: > > On Fri, Aug 12, 2011 at 6:18 PM, Craig White > wrote: > > On Aug 11, 2011, at 10:40 AM, Craig White wrote: > > > On Aug 10, 2011, at 11:10 PM, Ohad Levy wrote:


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

>
> Thanks, i guess the error message was simply misleading.
>
> if you can, please open a new issue, and ideally send a patch too :slight_smile:
>
> many thanks,
> Ohad
> –
> You received this message because you are subscribed to the Google Groups "Foreman users" group.
> To post to this group, send email to foreman-users@googlegroups.com.
> To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.
>

··· On Aug 14, 2011, at 4:24 AM, Ohad Levy wrote: ---- done

Refactor #1112

http://theforeman.org/issues/1112

Craig