Bug #1397
closedStatistics view is missing
Description
If you try to view the statistics, the page won't displayed
Files
Updated by Ohad Levy about 13 years ago
- Status changed from New to Feedback
hmm.. that is odd, any chance you are blocked by permissions? I cant reproduce it
Updated by Florian Koch about 13 years ago
Hm ,
i currently only use the admin user, so i should have all permissions
rgds f0
Updated by Florian Koch about 13 years ago
logs:
Started GET "/statistics" for 10.61.203.71 at Thu Dec 15 15:10:22 +0100 2011 Processing by StatisticsController#index as HTML ESC[1mESC[36mUser Load (0.2ms)ESC[0m ESC[1mSELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1ESC[0m Setting current user thread-local variable to admin ESC[1mESC[35mSQL (0.3ms)ESC[0m SELECT COUNT(*) AS count_all, operatingsystem_id AS operatingsystem_id FROM "hosts" GROUP BY operatingsystem_id ESC[1mESC[36mOperatingsystem Load (0.2ms)ESC[0m ESC[1mSELECT "operatingsystems".* FROM "operatingsystems" WHERE "operatingsystems"."id" IN (2, 1, 3, 4) ORDER BY LOWER(operatingsystems.name)ESC[0m ESC[1mESC[35mSQL (0.4ms)ESC[0m SELECT COUNT(*) AS count_all, architecture_id AS architecture_id FROM "hosts" GROUP BY architecture_id ESC[1mESC[36mArchitecture Load (0.2ms)ESC[0m ESC[1mSELECT "architectures".* FROM "architectures" WHERE "architectures"."id" = 1 LIMIT 1ESC[0m ESC[1mESC[35mSQL (0.2ms)ESC[0m SELECT COUNT(*) AS count_all, environment_id AS environment_id FROM "hosts" GROUP BY environment_id ESC[1mESC[36mEnvironment Load (0.2ms)ESC[0m ESC[1mSELECT "environments".* FROM "environments" WHERE "environments"."id" IN (13, 17, 16) ORDER BY LOWER(environments.name)ESC[0m ESC[1mESC[35mSQL (0.4ms)ESC[0m SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"host_classes"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum ESC[1mESC[36mSQL (0.4ms)ESC[0m ESC[1m SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"host_classes"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum ESC[0m ESC[1mESC[35mSQL (0.4ms)ESC[0m SELECT COUNT(DISTINCT "hosts"."id") AS count_id, puppetclass_id AS puppetclass_id FROM "hosts" LEFT OUTER JOIN "host_classes" ON "hosts"."id" = "host_classes"."host_id" LEFT OUTER JOIN "puppetclasses" ON "puppetclasses"."id" = "host_classes"."puppetclass_id" GROUP BY puppetclass_id ESC[1mESC[36mPuppetclass Load (0.2ms)ESC[0m ESC[1mSELECT "puppetclasses".* FROM "puppetclasses" WHERE "puppetclasses"."id" = 134 ORDER BY LOWER(puppetclasses.name) LIMIT 1ESC[0m not found: Couldn't find Puppetclass with ID=134 ESC[1mESC[35mUsergroup Load (0.3ms)ESC[0m SELECT "usergroups".* FROM "usergroups" INNER JOIN "usergroup_members" ON "usergroups".id = "usergroup_members".usergroup_id WHERE (("usergroup_members".member_type = 'User') AND ("usergroup_members".member_id = 1)) ORDER BY LOWER(usergroups.name) ESC[1mESC[36mBookmark Load (0.3ms)ESC[0m ESC[1mSELECT "bookmarks".* FROM "bookmarks" WHERE (((bookmarks.public = 't') OR (bookmarks.owner_id in (NULL) AND bookmarks.owner_type = 'Usergroup') OR (bookmarks.owner_id = 1 AND bookmarks.owner_type = 'User'))) ORDER BY nameESC[0m Rendered bookmarks/_list.html.erb (1.7ms) Rendered bookmarks/_list.html.erb (0.4ms) Rendered home/_settings.html.erb (6.4ms) Rendered home/_user_dropdown.rhtml (0.9ms) Rendered home/_topbar.rhtml (15.9ms) ESC[1mESC[35mNotice Load (0.3ms)ESC[0m SELECT * FROM "notices" INNER JOIN "user_notices" ON "notices".id = "user_notices".notice_id WHERE ("user_notices".user_id = 1 ) Rendered common/404.rhtml within layouts/application (21.9ms) Completed 404 Not Found in 53ms (Views: 37.9ms | ActiveRecord: 4.5ms)
Updated by Ohad Levy about 13 years ago
it could be that it was capturing the wrong error message.
Can you try running it again against the latest develop branch?
Thanks
Updated by Florian Koch about 13 years ago
Hi,
ok retryed with latest git rev efed96805ae43e1de1230698db6b688a88c41559
Started GET "/statistics" for xx.xx.xx.xx at Fri Dec 30 14:30:31 +0100 2011 Processing by StatisticsController#index as HTML Rendered bookmarks/_list.html.erb (1.8ms) Rendered bookmarks/_list.html.erb (0.4ms) Rendered home/_settings.html.erb (6.6ms) Rendered home/_user_dropdown.rhtml (0.9ms) Rendered home/_topbar.rhtml (16.6ms) Rendered common/404.rhtml within layouts/application (22.7ms) Completed 404 Not Found in 37ms (Views: 22.6ms | ActiveRecord: 4.3ms)
Updated by Ohad Levy about 13 years ago
can you try commenting out each graph in app/controllers/statistics_controller.rb ? one of them is failing
Updated by Florian Koch about 13 years ago
the problematic statistic os
@klass_count = Host.count_habm "puppetclass"
Updated by Florian Koch about 13 years ago
- Status changed from Feedback to Closed
- Assignee set to Ohad Levy
- % Done changed from 0 to 100
hi,
this bug comes from some inconsistence in my database, so no foreman bug.
rgds florian
Updated by Ben Hagen almost 13 years ago
ran in to the same problem with the last nightly build on ubuntu 12.04 (0.5-~nightlybuild1335243919)
when commenting out the following lines in app/controllers/statistics_controller.rb it works
@os_count = Host.count_distribution :operatingsystem @arch_count = Host.count_distribution :architecture
Updated by Ohad Levy almost 13 years ago
deb nightly are actually really old, see http://groups.google.com/group/foreman-users/browse_thread/thread/32bc84ecb81aa8b/ebad521e91966ce0?lnk=gst&q=nightly#ebad521e91966ce0
Updated by Ben Hagen almost 13 years ago
got kind of the same problem with the latest version from git when there where no environments defined
Updated by Greg Sutcliffe almost 13 years ago
@Ohad Levy - 3 days after I take over the nightlies, and you've forgotten me already? I'll put that down to Jet Lag :P
@benhagen - I can't reproduce I'm afraid - a fresh install of Foreman shows both of those graphs. That's sqlite3 on Debian 6. As per Florian's last update, is it possible you have some database oddness? What happens if you point Foreman at a brand new database?