Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 500 showing some project pages related to remote-linked OBS instance #1149

Closed
afaerber opened this issue Sep 21, 2015 · 5 comments
Closed
Labels
Bug Frontend Things related to the OBS RoR app

Comments

@afaerber
Copy link
Member

My /srv/www/obs/api/log/production.log has these details on the error:

[26f38f6e-6db9-4416-87a5-f178f895f0bb] [1111:1355.10] Started GET "/project/show/openSUSE:Factory:MIPS" for 192.168.1.51 at 2015-09-21 13:59:01 +0200
[26f38f6e-6db9-4416-87a5-f178f895f0bb] [1111:1355.11] Processing by Webui::ProjectController#show as HTML
[26f38f6e-6db9-4416-87a5-f178f895f0bb] [1111:1355.11]   Parameters: {"project"=>"openSUSE:Factory:MIPS"}
[26f38f6e-6db9-4416-87a5-f178f895f0bb] [1111:1355.11] Anonymous request to 'https://fels.lan/project/show/openSUSE:Factory:MIPS'
[26f38f6e-6db9-4416-87a5-f178f895f0bb] [1111:1355.16] Completed 500 Internal Server Error in 47ms (ActiveRecord: 8.6ms | Backend: 0.0ms | XML: 0.0ms)
[26f38f6e-6db9-4416-87a5-f178f895f0bb] [1111:1355.18] 
NoMethodError (undefined method `packages' for "openSUSE.org:openSUSE:Factory":String):
  app/models/project.rb:1058:in `block in linked_packages'
  app/models/project.rb:1058:in `map'
  app/models/project.rb:1058:in `linked_packages'
  app/controllers/webui/project_controller.rb:904:in `load_project_info'
[...]

Before updating, this showed a page with just two local packages in the main area and all inherited plus local packages in the status box to the right.

Its local parent project openSUSE:Factory (which has no local packages and links to openSUSE.org:openSUSE:Factory) shows as before, with no package in the main area and inherited package count in the status box to the right.

A new local test project without and with a test package shows fine, too.

Accessing the monitor page of the error'ing project works just fine and lists all, e.g., unresolvable inherited packages.

If I access the linking project openSUSE.org, it shows an Error 500, too:

[979e6e9b-1b13-4599-a53f-2ec2878b8e0b] [1111:3693.72] Started GET "/project/show/openSUSE.org" for 192.168.1.51 at 2015-09-21 14:38:00 +0200
[979e6e9b-1b13-4599-a53f-2ec2878b8e0b] [1111:3693.74] Processing by Webui::ProjectController#show as HTML
[979e6e9b-1b13-4599-a53f-2ec2878b8e0b] [1111:3693.74]   Parameters: {"project"=>"openSUSE.org"}
[...]
[979e6e9b-1b13-4599-a53f-2ec2878b8e0b] [1111:3693.87] Completed 500 Internal Server Error in 130ms (ActiveRecord: 20.2ms | Backend: 0.0ms | XML: 0.0ms)
[979e6e9b-1b13-4599-a53f-2ec2878b8e0b] [1111:3693.90] 
ActionView::Template::Error (undefined method `value' for #<Project:0xb5443b70>):
    77:         <% if @project.is_remote? %>
    78:             <li>
    79:               <%= sprite_tag 'information' %>
    80:               Links against the remote OBS instance at: <i><%= link_to_if(@project.value('remoteurl'),
    81:                                                                           @project.value('remoteurl'), @project.value('remoteurl')) %></i>
    82:             </li>
    83:         <% end %>
  activemodel (4.2.4) lib/active_model/attribute_methods.rb:433:in `method_missing'
  app/views/webui/project/show.html.erb:80:in `block in _app_views_webui_project_show_html_erb__773236464_17483004'

Possibly related is that on that project page it previously unexpectedly did not display the snippet visible in the error stack trace.

Seems like handling of linked OBS instances broke?

I doubt that my mime-types package version has anything to do with this, but I'm gonna check tonight just in case.

@adrianschroeter adrianschroeter added Bug Frontend Things related to the OBS RoR app Regression labels Sep 21, 2015
@adrianschroeter
Copy link
Member

most likely a one liner check in app/models/project.rb:1058, but a test case is needed as well

@adrianschroeter
Copy link
Member

and why didn't the spider test found this?

@afaerber
Copy link
Member Author

Fix for the second problem is s/@project.value('remoteurl')/@project.remoteurl/g in /srv/www/obs/api/app/views/webui/project/show.html.erb.

@afaerber
Copy link
Member Author

As for the first one, inserting .reject{|project| project.kind_of? String} in line 1058 works around the error 500, but I assume the bug is the string rather than an object showing up there in the first place?

afaerber added a commit to afaerber/open-build-service that referenced this issue Oct 3, 2015
The @project.value('remoteurl') method no longer exists, use the
.remoteurl field instead. (equivalent changes for .name in 8b4d426)

Avoids an Error 500 page and thereby resolves part of issue openSUSE#1149.

Signed-off-by: Andreas Färber <afaerber@suse.de>
@afaerber
Copy link
Member Author

The first issue seems resolved now, too. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frontend Things related to the OBS RoR app
Projects
None yet
Development

No branches or pull requests

2 participants