Host not found when clicking Edit from the UI?

Hi,
I apologize if I've missed this, but I wasn't able to craft a search to
produce a discussion on anything like this. I had a Foreman UI user with
admin privs ask me about why he can't edit a host, which immediately seemed
really odd. I have confirmed that foreman responds properly when editing
other hosts, but this one is odd. Basically when he (or anyone) clicks the
Edit button from /hosts/test.udayton.edu/ in the UI, we get a 404. The
production.log out put is pasted here: http://pastebin.com/WnwBt8a7 but
it's fairly useless. Clicking other buttons from the
/hosts/test.udayton.edu/ page produce the desired result - yaml, facts,
reports, audits, etc. Also we have locs and orgs enabled and it appears
that this host is "unmanaged"…it's a sparc Solaris 10 machine that
pre-existed our puppet/foreman implementation.

I see there's a bug issue #6770 that might be related, but there has been
no updates. Bug #6770: Removing a hostgroup from a location after a host has been created leads to "host not found" error while trying to edit said host. - Foreman Could this be a
match for that? The funny thing is that I show no audit history for
changing the hostgroup this guy belongs to…though I suppose this could
have been created when I enabled Orgs/Locs after upgrading to 1.7.2. Is
there a simple way to re-establish the yaml for a host if I were to delete
the host from Foreman and have puppetmaster re-create it?

Any thoughts or ideas would be appreciated.

Many thanks!

I can confirm that if I disable orgs and locs the host becomes editable
again. I don't quite get what the mismatch is though, both areas report
not mismatches.

··· On Tuesday, March 31, 2015 at 10:44:06 AM UTC-4, Sean Alderman wrote: > > Hi, > I apologize if I've missed this, but I wasn't able to craft a search to > produce a discussion on anything like this. I had a Foreman UI user with > admin privs ask me about why he can't edit a host, which immediately seemed > really odd. I have confirmed that foreman responds properly when editing > other hosts, but this one is odd. Basically when he (or anyone) clicks the > Edit button from /hosts/test.udayton.edu/ in the UI, we get a 404. The > production.log out put is pasted here: http://pastebin.com/WnwBt8a7 but > it's fairly useless. Clicking other buttons from the /hosts/ > test.udayton.edu/ page produce the desired result - yaml, facts, reports, > audits, etc. Also we have locs and orgs enabled and it appears that this > host is "unmanaged"...it's a sparc Solaris 10 machine that pre-existed our > puppet/foreman implementation. > > I see there's a bug issue #6770 that might be related, but there has > been no updates. http://projects.theforeman.org/issues/6770 Could this > be a match for that? The funny thing is that I show no audit history for > changing the hostgroup this guy belongs to...though I suppose this could > have been created when I enabled Orgs/Locs after upgrading to 1.7.2. Is > there a simple way to re-establish the yaml for a host if I were to delete > the host from Foreman and have puppetmaster re-create it? > > Any thoughts or ideas would be appreciated. > > Many thanks! >

I've seen that once or twice before, although not for a long while. I
had hoped it had gone away since I couldn't reproduce it.

If you enable debug logs and try to edit the host, the SQL will
probably look like it's trying to select from a set that can't
possibly work (exact SQL is escaping my memory, sorry). If that's so,
then there's a mismatch that we're somehow not detecting. That means
(a) a bug report :P, and (b) a very laborious task in checking that
all resources the host uses or is nested within belong to the
appropriate org/loc (which, I agree, is a giant pain).

If you can find the issue and a way to reproduce it, I'm sure we'd be
happy to figure out why the mismatch report isn't picking it up.

··· On 31 March 2015 at 16:27, Sean Alderman wrote: > I can confirm that if I disable orgs and locs the host becomes editable > again. I don't quite get what the mismatch is though, both areas report not > mismatches.