h icon indicating copy to clipboard operation
h copied to clipboard

ValueError: :userid isn't a valid userid

Open sentry-io[bot] opened this issue 5 years ago • 4 comments

Sentry Issue: H-1QA

ValueError: :userid isn't a valid userid
(7 additional frame(s) were not displayed)
...
  File "pyramid/router.py", line 128, in handle_request
    tdict = traverser(request)
  File "pyramid/traversal.py", line 730, in __call__
    next = getitem(segment)
  File "h/traversal/roots.py", line 286, in __getitem__
    user = self.user_svc.fetch(userid)
  File "h/services/user.py", line 59, in fetch
    parts = split_user(userid)
  File "h/util/user.py", line 18, in split_user
    raise ValueError("{userid} isn't a valid userid".format(userid=userid))

sentry-io[bot] avatar Nov 05 '19 17:11 sentry-io[bot]

I believe this is a fix for this: https://github.com/hypothesis/h/pull/5760 — just need time to get back to finishing up that PR. Anyone else is welcome to take this.

lyzadanger avatar Nov 05 '19 17:11 lyzadanger

Oh noes... I've also fixed this in a different way in:

https://github.com/hypothesis/h/pull/5819

jon-betts avatar Nov 05 '19 17:11 jon-betts

@jon-betts I've no attachment whatsoever to my (inelegant) fix. Please feel free to close mine and use yours.

lyzadanger avatar Nov 05 '19 17:11 lyzadanger

@lyzadanger Well I suppose it's mostly a learning exercise. The fact I ended up with a fix in the same place in the code is a good thing!

I want to see if I can get it to work with a specific error, as raising ValueError here scares me a bit.

jon-betts avatar Nov 05 '19 17:11 jon-betts