Mailinglist Archive: opensuse-buildservice (295 mails)

< Previous Next >
Re: [opensuse-buildservice] undefined method `name'
  • From: Andreas Bauer <abauer@xxxxxxx>
  • Date: Tue, 20 Mar 2007 15:52:35 +0100
  • Message-id: <200703201552.35868.abauer@xxxxxxx>
On Tuesday, 20. March 2007 14:30, Jochen Hebbrecht wrote:
> 2007/3/20, Andreas Bauer <abauer@xxxxxxx>:
> > On Tuesday, 20. March 2007 10:28, Jochen Hebbrecht wrote:
> > > Maybe if somebody solves this ... some time :p. After you login, you
> > > click at "Home Project" and it gives this error:
> >
> > -------->8---------
> >
> > > [D|#32051] uri is: rest://192.168.253.76:80/source/:project
> > > [D|#32051] http_do: url: http://192.168.253.76:80/source/home:admin
> > > [D|#32051] http_do: path: /source/home:admin
> > > [F|#32051]
> > >
> > > NoMethodError (undefined method `name' for #<Project:0xb6cbdda4>):
> > > /srv/www/obs/common/lib/activexml/node.rb:265:in `method_missing'
> > > /srv/www/obs/common/lib/activexml/base.rb:82:in `name'
> > > /app/controllers/project_controller.rb:90:in `show'
> >
> > --------8<---------
> >
> > could you please post the output of
> >
> > curl -v http://192.168.253.76:80/source/home:admin
>
> For the others (because I only said it on IRC): you have to fill in
> your DB by yourself. Do an INSERT like this one:

Wrong. You should never have to touch the DB yourself.

The problem is a 200 response from the API instead of a 404 response when a
project doesn't exist.

Normal case:

1. Client sends GET request for home project metafile.
2. Frontend doesn't find project data in DB, responds with an 404
3. Client recognizes 404 and offers to create the project.
4. User enters data.
5. Client sends PUT request for home project metafile.
6. Frontend creates project.

Your case:

1. Client sends GET request for home project metafile.
2. Frontend doesn't find project data in DB, responds with an -->200<--
3. Client thinks the response contains a metafile and tries to access it.
4. Client is confused because the xml doesn't look like expected, and bails.


I wasn't able to reproduce this locally, so I can't really tell you how to fix
it properly. But fiddling around with the database directly is definitely not
the correct way. It may cause more problems than solving.

Bye,
Andreas
--
Andreas Bauer - Novell - SUSE Internal Tools
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups