Hi Rohit,

thanks!

Having a recent DB backup at hand and only based on guesses, I did some
further experiments yesterday :)
- Rerun /usr/share/cloudstack-common/scripts/util/migrate-
dynamicroles.py
- Checked cloudstack-usage 4.8.0.1 instead of 4.9
- Updated back to cloudstack-usage 4.9
... and magically, it works after I changed the pid of the latest
cloud_usage.usage_job to the corresponding pid.

Though, I don't think thats the recommended way for a fix as I don't
know why it's working...

cloud.account shows role_id for every active account.
cloud_usage.account now shows role_id for these accounts also.
Only PrjAcct-$projectname-$id has role_id set to NULL, but I assume
this is correct since Projects are not assigned to roles.

Anyway, the metric/quota reports are working!

- Stephan

Am Donnerstag, den 18.08.2016, 09:03 +0000 schrieb Rohit Yadav:
> Hi Stephan,
> 
> 
> In cloud_usage.account `role_id` can be NULL as there is no user of
> this field within the usage server. In cloud.account, the `role_id`
> should be automatically populated/migrated when you upgraded. From
> your shared db query result, I'm not sure if that's a select query on
> cloud.account or cloud_usage.account, can you confirm it?
> 
> 
> Based on the exception, we can only get that if the account being
> saved don't have any role_id defined. With a new account created and
> usage records generated, I could not reproduce your issue. It is
> likely caused by an account in cloud.account table whose role_id is
> NULL.
> 
> 
> Can you check (and share) that all of your accounts in cloud database
> (cloud.account) have non-NULL role_id? Please fix anything that is
> NULL. For root admin account type use set role_id=1, for resource
> admin set role_id=2, for domain admin set role_id=3 and for user
> account set role_type=4;
> 
> 
> Regards.
> 
> rohit.ya...@shapeblue.com 
> www.shapeblue.com
> 53 Chandos Place, Covent Garden, London  WC2N 4HSUK
> @shapeblue
>   
>  
> 

Reply via email to