Mailinglist Archive: opensuse-buildservice (339 mails)

< Previous Next >
[opensuse-buildservice] missing bugowner role (trunk)
  • From: Marcus Hüwe <suse-tux@xxxxxx>
  • Date: Mon, 17 Mar 2008 22:02:43 +0100
  • Message-id: <20080317210243.GC3679@xxxxxxxxxxxxxxxxxxx>
Hi,

it seems that the frontend_development database misses a bugowner
entry in the "roles" table after running "rake db:migrate".
If I create a new package with a bugowner element, the frontend
complains afterwards if I try to add a new file (see attached development.log).
I attached a small patch which should fix this problem.


Marcus
Processing SourceController#file (for 127.0.42.2 at 2008-03-17 18:09:03) [PUT]
Session ID:
BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--4f4ae8f387319849b401645480857a6c951893b4
Parameters: {"rev"=>"upload", "project"=>"home:Admin", "action"=>"file",
"package"=>"bar", "controller"=>"source", "file"=>"foo"}
checking schema map for controller 'source', action 'file'
schema_file:
schema path not set, skipping validation
AUTH: BasicQWRtaW46b3BlbnN1c2U=
SQL (0.000618) SHOW TABLES
User Columns (0.001583) SHOW FIELDS FROM `users`
User Load (0.000506) SELECT * FROM `users` WHERE (login = 'Admin') LIMIT 1
USER found: Admin
User Admin initialised
User's source backend <:>, rpm backend: <:>
User Admin wants to change the package
Join Table Columns (0.001193) SHOW FIELDS FROM `roles_users`
Role Load (0.000396) SELECT * FROM `roles` INNER JOIN roles_users ON
roles.id = roles_users.role_id WHERE (roles_users.user_id = 1 )
Role Columns (0.000939) SHOW FIELDS FROM `roles`
Join Table Columns (0.001114) SHOW FIELDS FROM `groups_users`
Group Load (0.000340) SELECT * FROM `groups` INNER JOIN groups_users ON
groups.id = groups_users.group_id WHERE (groups_users.user_id = 1 )
Join Table Columns (0.001265) SHOW FIELDS FROM `roles_static_permissions`
StaticPermission Load (0.000516) SELECT * FROM `static_permissions` INNER
JOIN roles_static_permissions ON static_permissions.id =
roles_static_permissions.static_permission_id WHERE
(roles_static_permissions.role_id = 1 )
StaticPermission Columns (0.000898) SHOW FIELDS FROM `static_permissions`
[backend] PUT: /source/home:Admin/bar/foo?rev=upload&user=Admin
initializing model Package
Package.find( "bar", {:project=>"home:Admin"} )
prepared find args: ["bar", {:project=>"home:Admin", :name=>"bar"}]
[BSSQL] find( Package, ["bar", {:project=>"home:Admin", :name=>"bar"}] )
retrieving target_uri for model ':package'
retrieving option hash for model ':package'
[BSSQL] query_from_options: {:project=>"home:Admin", :name=>"bar"}
[BSSQL] query_from_options: query is: '@project='home:Admin' and @name='bar''
DbPackage Columns (0.001533) SHOW FIELDS FROM `db_packages`
[BSSQL] join string: ", db_projects"
[BSSQL] find conditions: ["db_packages.name LIKE BINARY ? AND
db_packages.db_project_id = db_projects.id AND db_projects.name = ?", "bar",
"home:Admin"]
DbPackage Load (0.000480) SELECT db_packages.* FROM `db_packages` ,
db_projects WHERE (db_packages.name LIKE BINARY 'bar' AND
db_packages.db_project_id = db_projects.id AND db_projects.name = 'home:Admin')
---> ["to_axml", "to_axml_id", "to_a"]
----------------- rendering package bar ------------------------
DbProject Columns (0.001330) SHOW FIELDS FROM `db_projects`
DbProject Load (0.000301) SELECT * FROM `db_projects` WHERE
(`db_projects`.`id` = 3)
User Load (0.000450) SELECT bu.*, r.title AS role_name FROM `users` bu,
package_user_role_relationships purr, roles r WHERE (bu.id = purr.bs_user_id
AND purr.db_package_id = 21 AND r.id = purr.role_id)
BuildFlag Columns (0.001363) SHOW FIELDS FROM `flags`
SQL (0.000274) SELECT count(*) AS count_all FROM `flags` WHERE
(flags.db_package_id = 21) AND ( (`flags`.`type` = 'BuildFlag' ) )
PublishFlag Columns (0.001210) SHOW FIELDS FROM `flags`
SQL (0.000245) SELECT count(*) AS count_all FROM `flags` WHERE
(flags.db_package_id = 21) AND ( (`flags`.`type` = 'PublishFlag' ) )
DebugFlag Columns (0.001199) SHOW FIELDS FROM `flags`
SQL (0.000240) SELECT count(*) AS count_all FROM `flags` WHERE
(flags.db_package_id = 21) AND ( (`flags`.`type` = 'DebugFlag' ) )
UseforbuildFlag Columns (0.001191) SHOW FIELDS FROM `flags`
SQL (0.000237) SELECT count(*) AS count_all FROM `flags` WHERE
(flags.db_package_id = 21) AND ( (`flags`.`type` = 'UseforbuildFlag' ) )
----------------- end rendering package bar ------------------------
[BSSQL] saving object



SQL (0.000099) BEGIN
DbPackage Load (0.000412) SELECT pack.*
FROM db_packages pack
LEFT OUTER JOIN db_projects pro ON pack.db_project_id = pro.id
WHERE pro.name = BINARY 'home:Admin' AND pack.name = BINARY 'bar'

PackageUserRoleRelationship Load (0.000412) SELECT * FROM
`package_user_role_relationships` WHERE
(package_user_role_relationships.db_package_id = 21)
PackageUserRoleRelationship Columns (0.000991) SHOW FIELDS FROM
`package_user_role_relationships`
User Load (0.000283) SELECT * FROM `users` WHERE (`users`.`id` = 1)
SQL (0.074480) ROLLBACK


NoMethodError (You have a nil object when you didn't expect it!
The error occurred while evaluating nil.title):
/app/models/db_package.rb:84:in `store_axml'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in
`each'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in
`send'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_proxy.rb:125:in
`method_missing'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_collection.rb:162:in
`method_missing'
/app/models/db_package.rb:82:in `store_axml'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in
`transaction'
/app/models/db_package.rb:69:in `store_axml'
/app/models/db_package.rb:41:in `store_axml'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in
`transaction'
/app/models/db_package.rb:31:in `store_axml'
/srv/www/obs/common/lib/activexml/transport.rb:230:in `save'
/srv/www/obs/common/lib/activexml/base.rb:92:in `save'
/app/models/package.rb:36:in `update_timestamp'
/app/controllers/source_controller.rb:482:in `file'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in
`send'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in
`call_filters'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in
`perform_action'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'

/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in
`cache'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in
`perform_action'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in
`send'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in
`process_without_filters'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in
`process'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in
`process'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in
`handle_request'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in
`dispatch'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi'

/usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in
`dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:101:in
`process_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:149:in
`with_signal_handler'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:99:in
`process_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:77:in
`process_each_request'
/usr/lib/ruby/vendor_ruby/1.8/fcgi.rb:612:in `each_cgi'
/usr/lib/ruby/vendor_ruby/1.8/fcgi.rb:609:in `each'
/usr/lib/ruby/vendor_ruby/1.8/fcgi.rb:609:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:76:in
`process_each_request'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:50:in `process!'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:24:in `process!'
/public/dispatch.fcgi:24

Rendering status
errorcode 'uncaught_exception' - You have a nil object when you didn't expect
it!
The error occurred while evaluating nil.title
Rendering status (500)
Index: db/migrate/026_permission_update.rb
===================================================================
--- db/migrate/026_permission_update.rb (Revision 3552)
+++ db/migrate/026_permission_update.rb (Arbeitskopie)
@@ -6,6 +6,8 @@

# add local maintainer role
r = Role.create( :title => "maintainer" )
+ # add local bugowner role
+ Role.create( :title => "bugowner" )

# update relationship tables
rename_column :project_user_role_relationships, :bs_role_id, :role_id
< Previous Next >
Follow Ups