adelevie/parse_resource

Error when saving a new user

TimSullivan opened this issue · 9 comments

When I attempt to save a new user, I get an error:

TypeError in UsersController#create

class or module required for rescue clause

parse_resource (1.8.0) lib/parse_resource/base.rb:401:in `rescue in save'
parse_resource (1.8.0) lib/parse_resource/base.rb:390:in `save'
app/controllers/users_controller.rb:9:in `create'

The user class is pretty simple:

class User < ParseUser
  alias :email :username
  fields :email, :first_name, :last_name
end

I've tried to dig into things, and it appears to be that I'm getting 401 Unauthorized, however, when I do this in the console:

irb(main):005:0> u=User.new
=> #<User:0x007fd314251f40 @unsaved_attributes={}, @attributes={}, @error_instances=[]>
irb(main):006:0> u.email='tim@someemail.com'
=> "tim@someemail.com"
irb(main):007:0> u.username='tim@someemail.com'
=> "tim@someemail.com"
irb(main):008:0> u.password='password'
=> "password"

u.resource
=> #<RestClient::Resource:0x007fd31584d358 @url="https://api.parse.com/1/users", @block=nil, @options={:user=>"<AppID Removed>", :password=>"<API Key Removed>"}>
irb(main):006:0> u.create
RuntimeError: Parse error : Unknown Error unauthorized

The user and password fields seem correct. I've tried with both the REST API Key and the Master API Key, but in both cases, calling create brings up the error.

Using the standard parse-ruby-client gem works fine, so I know I've got the keys right.

I had a similar error. My problem was that I forgot to create columns for my database table on Parse.com's Data Browser.

I had a similar error as well. My problem was I had the App name instead of the App ID in the yml file. Make sure you use the two tokens from your app's Settings --> Application Keys pane. (App ID and Master Key).

I also added the app name in the yaml, just for documentation purposes.

This error message could be improved though.

Tim, is this still an issue for you?

Started integration and getting same error, both of said solutions are not working for me, any idea ?

Thanks

FYI:

The said error comes up when try record.save and when tried record.create the error is different

RuntimeError: Parse error 201: Unknown Error missing user password

Thanks

The issue is with User model as created a new model with Post name and it works smoothly, though also followed "class User < ParseUser" statement but still same error, though can play around now.

Thanks for great work.

Im having this same error - columns are present on parse data browser and keys are correct - Im not clear on what the fix was for you JahangerGull - any update on what the problem may be?

Having this same error with the User object in parse-rails-boilerplate project. Any updates?

I had same error, I fixed it by removing some unnecessary applicationId, and master key from global.json file