Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groovy.lang.MissingPropertyException in Lock User #42

Open
srpape opened this issue Jun 10, 2017 · 3 comments
Open

groovy.lang.MissingPropertyException in Lock User #42

srpape opened this issue Jun 10, 2017 · 3 comments

Comments

@srpape
Copy link

srpape commented Jun 10, 2017

Just saw the following error in the Lock User logs:

12:59:36 PM: error groovy.lang.MissingPropertyException: No such property: lock for class: java.lang.Boolean @ line 798

Seemed to occur after the user was in a "Controller failed to set code" state, after I reset the user.

The relevant code is the return lockApp.lock in this function:

def getLock(params) {
  def id = ''
  // Assign params to id.  Sometimes parameters are double nested.
  if (params?.id) {
    id = params.id
  } else if (params?.params){
    id = params.params.id
  } else if (state.lastLock) {
    id = state.lastLock
  }
  state.lastLock = id
  def lockApp = getLockApp(state.lastLock)

  return lockApp.lock
}

It appears getLockApp() returned false for some reason, and this function doesn't check for that condition.

@ethayer
Copy link
Owner

ethayer commented Jun 11, 2017

I can't replicate this. I've changed the code to add a try to the lock method, so it might stop the error from occurring, but probably won't solve the underlying issue.

Is it possible you somehow have a lock app installed without being connected to a lock? It would look like a blank line in the app screen. If there is, click into it and you should be able to remove the lock.

@srpape
Copy link
Author

srpape commented Jun 12, 2017

No, I have 5 locks, and they all have names. I'm not sure exactly how it happened.

I was in debug mode because I was having issues with one of the users failing to set a code on a lock, trying a bunch of things to get it working. It seemed to happen right after I reset the user.

Thanks for looking into it. If I can figure out a reliable way to reproduce it, I'll let you know.

@ethayer
Copy link
Owner

ethayer commented Jun 12, 2017

The lock not found error should be fixed now. I also added a delay to the user initialization after you reset a user because it seems like there was a race condition where...

  • a user would become valid for attempting to send it to the lock
  • initialization logic would run before the valid user is saved on ST.
  • the valid user would look invalid milliseconds before it became valid, and then ignored.

update from master and let me know if this helps.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants