You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have two instances of API Umbrella running behind a load balancer, that somehow ended up running different versions. The problem is, submitting the following as a POST to api-umbrella/v1/users:
succeeds in 0.14.1, but in 0.14.4 returns a 500 error, with this stack trace showing up in the logs:
2017-08-18T23:22:42.21596 Completed 500 Internal Server Error in 8ms 2017-08-18T23:22:42.21690 2017-08-18T23:22:42.21690 Mongoid::Errors::InvalidValue ( 2017-08-18T23:22:42.21690 message: 2017-08-18T23:22:42.21691 Value of type String cannot be written to a field of type Array 2017-08-18T23:22:42.21691 summary: 2017-08-18T23:22:42.21691 Tried to set a value of type String to a field of type Array 2017-08-18T23:22:42.21691 resolution: 2017-08-18T23:22:42.21691 Verify if the value to be set correspond to field definition): 2017-08-18T23:22:42.21691 lib/api_umbrella/attributify_data.rb:39:in 'assign_nested_attributes' 2017-08-18T23:22:42.21692 app/controllers/api/v1/users_controller.rb:99:in 'assign_attributes!' 2017-08-18T23:22:42.21692 app/controllers/api/v1/users_controller.rb:44:in 'create' 2017-08-18T23:22:42.21692 app/controllers/application_controller.rb:160:in 'set_userstamp' 2017-08-18T23:22:42.21693 app/controllers/application_controller.rb:88:in 'block in use_locale' 2017-08-18T23:22:42.21693 app/controllers/application_controller.rb:87:in 'use_locale'
Has a bug been introduced? Has there been some other change that requires a different model? Obviously I can't solve this by upgrading the older installation.
The text was updated successfully, but these errors were encountered:
anthonyz-davis
changed the title
POST to api-umbrella/v1/users succeeds in 0.14.1 but fails in 01.4.4
POST to api-umbrella/v1/users succeeds in 0.14.1 but fails in 0.14.4
Aug 25, 2017
@anthonyz-davis: Apologies for the delay, but thanks for reporting this. I believe this was actually due to a bug that was present in v0.14.0-0.14.1, but was fixed in v0.14.2. Specifically, there was a regression in array handling introduced in v0.14.0 that we later fixed: #367 (comment)
So I'm guessing the issue here is that the POST is sending "roles": "",, which is causing this problem, since roles should either be null or an array (but not a string itself). So we probably need to add some extra validations around that to handle this error more gracefully, but I think that type mismatch is what's triggering this error.
Are you making this POST yourself? If so, I think if you change the roles to send in an array or null, it should resolve the problem. Or if the problem was coming from the requests the v0.14.1 version of API Umbrella was making itself from the admin, then I think that should be resolved by upgrading to the latest version.
Hi @GUI
I need help for regenerate API key for existing user using rest API call.
OR there is any other way to delete user profile using rest API call.
We have two instances of API Umbrella running behind a load balancer, that somehow ended up running different versions. The problem is, submitting the following as a POST to api-umbrella/v1/users:
succeeds in 0.14.1, but in 0.14.4 returns a 500 error, with this stack trace showing up in the logs:
2017-08-18T23:22:42.21596 Completed 500 Internal Server Error in 8ms 2017-08-18T23:22:42.21690 2017-08-18T23:22:42.21690 Mongoid::Errors::InvalidValue ( 2017-08-18T23:22:42.21690 message: 2017-08-18T23:22:42.21691 Value of type String cannot be written to a field of type Array 2017-08-18T23:22:42.21691 summary: 2017-08-18T23:22:42.21691 Tried to set a value of type String to a field of type Array 2017-08-18T23:22:42.21691 resolution: 2017-08-18T23:22:42.21691 Verify if the value to be set correspond to field definition): 2017-08-18T23:22:42.21691 lib/api_umbrella/attributify_data.rb:39:in 'assign_nested_attributes' 2017-08-18T23:22:42.21692 app/controllers/api/v1/users_controller.rb:99:in 'assign_attributes!' 2017-08-18T23:22:42.21692 app/controllers/api/v1/users_controller.rb:44:in 'create' 2017-08-18T23:22:42.21692 app/controllers/application_controller.rb:160:in 'set_userstamp' 2017-08-18T23:22:42.21693 app/controllers/application_controller.rb:88:in 'block in use_locale' 2017-08-18T23:22:42.21693 app/controllers/application_controller.rb:87:in 'use_locale'
Has a bug been introduced? Has there been some other change that requires a different model? Obviously I can't solve this by upgrading the older installation.
The text was updated successfully, but these errors were encountered: