[opensuse-buildservice] problems with OBS 1.5rc2 after upgrading host to openSUSE 11.1
I had a number of problems after upgrading an OBS instance from openSUSE 11.0 to 11.1 The client remains running openSUSE 11.1, as it has for months. The osc version on the client has not changed and is the latest available. The first is that adding a *comment* via osc did not work. I could add and remove files (PUT/DELETE respectively), but the subsequent POST would not, returning a 403. I tracked it down to this code, in /srv/www/obs/frontend/app/controllers/source_controller.rb, near line 139: if not ['diff', 'branch'].include?(cmd) and not @http_user.can_modify_package?(pkg) I believe two things are wrong with this line. First, it does not include 'commit'. Second, the logic is wrong (it used AND instead of OR), and the corrected version is below. if not ['diff', 'branch', 'commit'].include?(cmd) or not @http_user.can_modify_package?(pkg) Why did this work fine with openSUSE 11.0 and not 11.1? The OBS versions are the same (1.5rc2)! Second problem: only for the 'Admin' user, editing the user info (/user/edit) fails every time with: undefined method `source_backend' for #<Person:0x7fac0a31a048> What might be going on here? -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Jon Nelson schrieb:
I had a number of problems after upgrading an OBS instance from openSUSE 11.0 to 11.1 The client remains running openSUSE 11.1, as it has for months. The osc version on the client has not changed and is the latest available.
The first is that adding a *comment* via osc did not work. I could add and remove files (PUT/DELETE respectively), but the subsequent POST would not, returning a 403.
I tracked it down to this code, in /srv/www/obs/frontend/app/controllers/source_controller.rb, near line 139:
if not ['diff', 'branch'].include?(cmd) and not @http_user.can_modify_package?(pkg)
I believe two things are wrong with this line. First, it does not include 'commit'. Second, the logic is wrong (it used AND instead of OR), and the corrected version is below.
if not ['diff', 'branch', 'commit'].include?(cmd) or not @http_user.can_modify_package?(pkg)
The original line is correct. The purpose of this conditional is to exclude 'diff' and 'branch' from the permission check. Every other command (including 'commit') requires the 'modify_package' permission. Evaluation of the original conditional shortcuts after (not ['diff', 'branch'].include?(cmd)) evaluates to false, which is the case if cmd is either 'branch' or 'diff'. If cmd is anything else, the second part of the 'and' is evaluated (permission check). If that fails (evaluating to true due to the leading 'not') a 403 is sent back. Otherwise the command is dispatched. Your version of the conditional would shortcut and evaluate to true every time a command not included in the list is sent, resulting in a 403 for those commands.
Why did this work fine with openSUSE 11.0 and not 11.1? The OBS versions are the same (1.5rc2)!
No idea, this needs to be investigated further.
Second problem: only for the 'Admin' user, editing the user info (/user/edit) fails every time with:
undefined method `source_backend' for #<Person:0x7fac0a31a048>
What might be going on here?
Are you trying to edit using the admin interface of the frontend or the user edit page of the webclient? -- Andreas Bauer SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nürnberg -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Fri, Mar 13, 2009 at 2:17 PM, Andreas Bauer <abauer@suse.de> wrote:
Jon Nelson schrieb:
I had a number of problems after upgrading an OBS instance from openSUSE 11.0 to 11.1 The client remains running openSUSE 11.1, as it has for months. The osc version on the client has not changed and is the latest available.
The first is that adding a *comment* via osc did not work. I could add and remove files (PUT/DELETE respectively), but the subsequent POST would not, returning a 403.
I tracked it down to this code, in /srv/www/obs/frontend/app/controllers/source_controller.rb, near line 139:
if not ['diff', 'branch'].include?(cmd) and not @http_user.can_modify_package?(pkg)
I believe two things are wrong with this line. First, it does not include 'commit'. Second, the logic is wrong (it used AND instead of OR), and the corrected version is below.
if not ['diff', 'branch', 'commit'].include?(cmd) or not @http_user.can_modify_package?(pkg)
The original line is correct.
The purpose of this conditional is to exclude 'diff' and 'branch' from the permission check. Every other command (including 'commit') requires the 'modify_package' permission.
OK. Why, then, does my user apparently no longer have sufficient permissions? As I said, i used this for quite some time (months) using openSUSE 11.0. The only thing i did was upgrade to 11.1, but this of course entailed reinstalling the obs* packages. I can PUT new files and DELETE existing files but not POST new commit messages?
Second problem: only for the 'Admin' user, editing the user info (/user/edit) fails every time with:
undefined method `source_backend' for #<Person:0x7fac0a31a048>
What might be going on here?
Are you trying to edit using the admin interface of the frontend or the user edit page of the webclient?
The web interface. Log in as Admin. Go to 'home'. Edit user info. Boom. :-( -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Fri, Mar 13, 2009 at 2:31 PM, Jon Nelson <jnelson-suse@jamponi.net> wrote:
On Fri, Mar 13, 2009 at 2:17 PM, Andreas Bauer <abauer@suse.de> wrote:
Jon Nelson schrieb:
I had a number of problems after upgrading an OBS instance from openSUSE 11.0 to 11.1 The client remains running openSUSE 11.1, as it has for months. The osc version on the client has not changed and is the latest available.
The first is that adding a *comment* via osc did not work. I could add and remove files (PUT/DELETE respectively), but the subsequent POST would not, returning a 403.
I have no idea why this is, but the *logfile* permissions were wrong. Why that resulted in a 403 (despite the action being successful) is beyond me, but the logfiles were owned by root.root. When I fixed that, my problems went away. The second problem still stands:
Second problem: only for the 'Admin' user, editing the user info (/user/edit) fails every time with:
undefined method `source_backend' for #<Person:0x7fac0a31a048>
What might be going on here?
Are you trying to edit using the admin interface of the frontend or the user edit page of the webclient?
The web interface. Log in as Admin. Go to 'home'. Edit user info. Boom. :-(
and I found a third one! Restarting obsworker results in a second screen session, and a third, and a fourth, and so on. obsworker's init script should kill the screen session that it starts. -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Fri, Mar 13, 2009 at 7:24 PM, Jon Nelson <jnelson-suse@jamponi.net> wrote:
On Fri, Mar 13, 2009 at 2:31 PM, Jon Nelson <jnelson-suse@jamponi.net> wrote:
On Fri, Mar 13, 2009 at 2:17 PM, Andreas Bauer <abauer@suse.de> wrote:
Jon Nelson schrieb:
I had a number of problems after upgrading an OBS instance from openSUSE 11.0 to 11.1 The client remains running openSUSE 11.1, as it has for months. The osc version on the client has not changed and is the latest available.
The first is that adding a *comment* via osc did not work. I could add and remove files (PUT/DELETE respectively), but the subsequent POST would not, returning a 403.
I have no idea why this is, but the *logfile* permissions were wrong. Why that resulted in a 403 (despite the action being successful) is beyond me, but the logfiles were owned by root.root. When I fixed that, my problems went away.
I spoke too soon. This morning my first checkin ... Sending foo.spec Transmitting file data ..Server returned an error: HTTP Error 403: Forbidden no permission to execute command 'commit' However when I check the project via the web interface the right files are there (but refuse to rebuild). Furthermore, with the web client I can upload/remove files without any problem at all. Only when using osc (osc-0.110-1.16 installed 4 Jan 2009) do I encounter problems, and only after upgrading from openSUSE 11.0 to 11.1. I'll try to be in #opensuse-buildservice today. -- Jon -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (2)
-
Andreas Bauer
-
Jon Nelson