#metabrainz

/

      • _lucifer
        alastairp, ruaok: regarding a separate blueprint for social features, do we consider similar-users part of core blueprint, social or different?
      • 2021-03-19 07852, 2021

      • alastairp
        🍅 🍅
      • 2021-03-19 07855, 2021

      • Cyna[m]
        Yea I have some idea of minified notifications but need to confirm the list of notification types with reo first. If the list is small. I can make a minified notification cause showing a mail in small notification bar doesnt make sense
      • 2021-03-19 07809, 2021

      • alastairp
        _lucifer: API blueprint?
      • 2021-03-19 07811, 2021

      • Cyna[m]
        Might need to have different template for site baed notifications
      • 2021-03-19 07845, 2021

      • c1e0 joined the channel
      • 2021-03-19 07803, 2021

      • _lucifer
      • 2021-03-19 07828, 2021

      • _lucifer
        the comment regarding adding a separate section in api docs
      • 2021-03-19 07803, 2021

      • _lucifer
        i think it makes sense to move this to a different api blueprint and a file.
      • 2021-03-19 07823, 2021

      • alastairp
        we could do this as a separate PR, formatting documentation is more important here
      • 2021-03-19 07848, 2021

      • _lucifer
        yup, i am taking care of that.
      • 2021-03-19 07804, 2021

      • alastairp
        I guess using a blueprint is the easiest way to group it together in the documentation, right? because it automatically brings in all of the views?
      • 2021-03-19 07809, 2021

      • _lucifer
        yes
      • 2021-03-19 07830, 2021

      • alastairp
        alternative we could format the file manually and list each api endpoint under a header (while they are still in the same bp)
      • 2021-03-19 07858, 2021

      • _lucifer
        yeah, but then we need to document each endpoint we add manually
      • 2021-03-19 07804, 2021

      • alastairp
        yeah
      • 2021-03-19 07812, 2021

      • _lucifer
        right now we only need to do that if we add a blueprint
      • 2021-03-19 07842, 2021

      • _lucifer
        also, i would like to think of the core api as only relating to listens
      • 2021-03-19 07859, 2021

      • alastairp
        hah, I started to say that and then I deleted it
      • 2021-03-19 07807, 2021

      • alastairp
        let's add a new social BP specifically for these methods added in this PR, but do no more
      • 2021-03-19 07820, 2021

      • _lucifer
        yes the PR is already getting big
      • 2021-03-19 07823, 2021

      • alastairp
        then we can open a ticket and propose a new split for the other methods
      • 2021-03-19 07832, 2021

      • _lucifer
        agreed
      • 2021-03-19 07808, 2021

      • c1e0_ joined the channel
      • 2021-03-19 07840, 2021

      • blup joined the channel
      • 2021-03-19 07840, 2021

      • blup has quit
      • 2021-03-19 07840, 2021

      • blup joined the channel
      • 2021-03-19 07827, 2021

      • sumedh_p joined the channel
      • 2021-03-19 07830, 2021

      • akashgp09 joined the channel
      • 2021-03-19 07852, 2021

      • c1e0 has quit
      • 2021-03-19 07852, 2021

      • sumedh has quit
      • 2021-03-19 07852, 2021

      • ZaphodBeeblebrox has quit
      • 2021-03-19 07839, 2021

      • _lucifer
        alastairp, regarding https://github.com/metabrainz/listenbrainz-server…, i see we are catching the `Exception` clause in many other endpoints as well.
      • 2021-03-19 07853, 2021

      • _lucifer
        regarding logging level, `error` instead of critical like we do elsewhere makes sense to me.
      • 2021-03-19 07803, 2021

      • akashgp09 has quit
      • 2021-03-19 07815, 2021

      • alastairp
        yes, this is another thing that we've tried a bunch of ideas for, but never come to a clear guideline on what to catch
      • 2021-03-19 07827, 2021

      • alastairp
        in lots of places we don't catch postgres errors, for example, and maybe we should
      • 2021-03-19 07851, 2021

      • alastairp
        what I'm trying to avoid with this comment is that we copy existing code, and then some random failure happens and sentry emails us
      • 2021-03-19 07825, 2021

      • alastairp
        we want to try and minimise the sentry emails, not increase them, otherwise they turn into noise and we can't find things to fix
      • 2021-03-19 07810, 2021

      • alastairp
        if logger.error sends a sentry email (I'm not 100% sure of this) then I don't want to receive it. Perhaps our logging setup is wrong, and we shouldn't integrate text logging and sentry error reporting with the same system
      • 2021-03-19 07836, 2021

      • BrainzGit
        [musicbrainz-server] reosarevok opened pull request #2005 (master…MBS-11451): MBS-11451: Support ratings for places https://github.com/metabrainz/musicbrainz-server/…
      • 2021-03-19 07820, 2021

      • _lucifer
        alastairp, yeah that makes sense. We even have a `log_raise_400` method but only use it sparingly.
      • 2021-03-19 07850, 2021

      • alastairp
        that's an even worse method - we removed a number of places where we called it
      • 2021-03-19 07812, 2021

      • _lucifer
        oh
      • 2021-03-19 07822, 2021

      • alastairp
        because we raise http400 when a user provides us with bad data, so it means that _we_ get a notification every time a user sends bad data to the API
      • 2021-03-19 07828, 2021

      • _lucifer
        yeah, right. :(
      • 2021-03-19 07821, 2021

      • alastairp
        I had ideas of using sentry as a general looger - for example being able to use it to track messages about how a process was running. but it never worked out very well
      • 2021-03-19 07829, 2021

      • adhawkins_ joined the channel
      • 2021-03-19 07855, 2021

      • adhawkins has quit
      • 2021-03-19 07858, 2021

      • alastairp
        at the time we wanted to get information about the execution of the recommendations, for example, and the options were to log to file (hard to read in the context of spark) or use sentry, so we decided to use sentry
      • 2021-03-19 07840, 2021

      • alastairp
        but mostly it resulted in stuff like this https://usercontent.irccloud-cdn.com/file/brfKHjk…
      • 2021-03-19 07801, 2021

      • alastairp
        which we can't do anything about :)
      • 2021-03-19 07833, 2021

      • alastairp
        so I've been trying to think about different ways of using sentry - just keep it as an error reporter. anything that appears on sentry is a bug in our code that we should improve
      • 2021-03-19 07840, 2021

      • adhawkins_ is now known as adhawkins
      • 2021-03-19 07859, 2021

      • _lucifer
        yeah that makes sense to me
      • 2021-03-19 07811, 2021

      • _lucifer
        >To summarize, Sentry works with your application logging infrastructure, often integrating directly. It does not replace the need for those logs, and it's also not a destination for things that aren't actionable errors or crashes.
      • 2021-03-19 07814, 2021

      • alastairp
        so this is why I'm unsure about the "try/except Exception: log to sentry" workflow
      • 2021-03-19 07856, 2021

      • alastairp
        I can see why we do it - it means that the user gets a nice "there was an error" message, and we still get the log information
      • 2021-03-19 07859, 2021

      • alastairp
        however, I'm thinking out loud - APIInternalServerError is still just a json error message
      • 2021-03-19 07841, 2021

      • _lucifer
        yeah, i think we would want InternalServerError. BadRequest not so much
      • 2021-03-19 07843, 2021

      • alastairp
        we get json error messages in https://github.com/metabrainz/listenbrainz-server… anyway, so we could just let it fail. sentry will log a message for us anyway, and the user will still get a json error message
      • 2021-03-19 07820, 2021

      • alastairp
        you're right about what sentry says that it does, but we have to consider that in the wider context of what resources we have available at MeB
      • 2021-03-19 07803, 2021

      • alastairp
        we _don't_ have a global log collecting service. that'd be another tool to run. so we then need to decide are we happy to ssh into servers and grep logs, or do we try and make sentry help us a little bit
      • 2021-03-19 07809, 2021

      • _lucifer
        yeah, thats true.
      • 2021-03-19 07822, 2021

      • alastairp
        I had hoped that we could use sentry, but I'm happy to admit that the experiment wasn't very successful
      • 2021-03-19 07803, 2021

      • _lucifer
        alastairp, for this PR, i'll remove the Exception clause and let it fail. let's open a ticker for what to do in the general context and discuss again later?
      • 2021-03-19 07827, 2021

      • Cyna[m] uploaded an image: (1359KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/evkdOOMJBEDtBgrnqIlJljCB/image.png >
      • 2021-03-19 07831, 2021

      • Cyna[m]
        Mr_Monkey: This is an example for icon
      • 2021-03-19 07855, 2021

      • Cyna[m]
        We obviously can use a better icon. This is just something I picked from google images.
      • 2021-03-19 07809, 2021

      • _lucifer
        alastairp: also, as a hack we could probably change the error hirerachy here https://github.com/metabrainz/listenbrainz-server… . Make `APIError` not inherit from `Exception` or create a separate base error for exceptions that should be treated as an Exception and captured by sentry.
      • 2021-03-19 07828, 2021

      • _lucifer
        would that be helpful at least in the short run while we come up with a better solution?
      • 2021-03-19 07849, 2021

      • Mr_Monkey
        Yeah, that's about the type of thing I would imagine
      • 2021-03-19 07857, 2021

      • Mr_Monkey
        (about the bell icon)
      • 2021-03-19 07823, 2021

      • Cyna[m] < https://matrix.org/_matrix/media/r0/download/matrix.org/dAmteBJaxkQzdpLytqMonVcT/message.txt >
      • 2021-03-19 07840, 2021

      • Cyna[m]
        This is all the ones I could find while reading the code
      • 2021-03-19 07808, 2021

      • RikkoM has quit
      • 2021-03-19 07808, 2021

      • RikkoM joined the channel
      • 2021-03-19 07857, 2021

      • blup
        wait 200 tracks is to much for a play list? since when ? :D
      • 2021-03-19 07810, 2021

      • blup
        wait why am I blup?
      • 2021-03-19 07822, 2021

      • blup
        man, my connection must be frazzled
      • 2021-03-19 07812, 2021

      • blup is now known as CatQuest
      • 2021-03-19 07801, 2021

      • ruaok
        Social, i think. But I don't feel strongly about it.
      • 2021-03-19 07852, 2021

      • alastairp
        _lucifer: oh, there's some extra flask magic here
      • 2021-03-19 07816, 2021

      • alastairp
        1) exceptions should always inherit from Exception
      • 2021-03-19 07820, 2021

      • alastairp
        2) you can do a flask error handler for a specific exception subclass (e.g. APIError), and flask will use the handler whenever this exception is raised. this is how we make errors in the API get returned in json (we have a handler for APIError that uses jsonify)
      • 2021-03-19 07843, 2021

      • alastairp
        what this doesn't cover though is programming errors that cause exceptions (ValueError, AttributeError, requests download error, postgres exec error). what we found is that any programming error that caused an exception would result in flask's default error handler being called, which returns html, even in the API
      • 2021-03-19 07844, 2021

      • alastairp
        it's likely that this pattern of catching Exception and returning an APIBadRequest was a way of forcing error messages to come out of the API as json
      • 2021-03-19 07824, 2021

      • alastairp
        however, this is what PR 1235 fixes. now any unhandled exception that happens while the URL starts with API_PREFIX will get converted into json no matter what the error is
      • 2021-03-19 07809, 2021

      • _lucifer
        alastairp, oh ok. i didn't know that.
      • 2021-03-19 07820, 2021

      • _lucifer
      • 2021-03-19 07859, 2021

      • _lucifer
        sentry python sdk seems to have an `ignore_errors` option to not report specific errors
      • 2021-03-19 07800, 2021

      • alastairp
        is this something that you can use to tell sentry to not report it if the exception is one of a specific type?
      • 2021-03-19 07807, 2021

      • alastairp
        what would be the use-case here?
      • 2021-03-19 07808, 2021

      • _lucifer
        yes
      • 2021-03-19 07820, 2021

      • _lucifer
        not report APIBadRequest
      • 2021-03-19 07841, 2021

      • alastairp
        does sentry currently report APIBadRequest?
      • 2021-03-19 07847, 2021

      • _lucifer
      • 2021-03-19 07823, 2021

      • alastairp
        oh, interesting! I didn't quite understand how this error was being report
      • 2021-03-19 07825, 2021

      • alastairp
        reported
      • 2021-03-19 07838, 2021

      • alastairp
        I thought that it came from a call to log_and_return_400
      • 2021-03-19 07815, 2021

      • _lucifer
        actually that too is a wrapper around `APIBadRequest`
      • 2021-03-19 07854, 2021

      • alastairp
        yes, right. because the flask error handler turns APIError into json, and APIBadRequest has a status code of 400
      • 2021-03-19 07811, 2021

      • alastairp
        so you're absolutely right here, good catch
      • 2021-03-19 07845, 2021

      • alastairp
        when we use an exception for specialist flask error handling (e.g. APIError) then we should tell sentry to not report it
      • 2021-03-19 07855, 2021

      • alastairp
        this is a bug in all flask apps
      • 2021-03-19 07832, 2021

      • alastairp
        what I'm unsure of is if we should also ignore werkzeug.exceptions.HTTPException
      • 2021-03-19 07845, 2021

      • alastairp
        maybe the sentry flask integration already does this?
      • 2021-03-19 07804, 2021

      • _lucifer
        could be, regarding that should we merge that PR and start updating apps to new sentry?
      • 2021-03-19 07811, 2021

      • alastairp
        good idea
      • 2021-03-19 07819, 2021

      • alastairp
        as you can see, lots of moving parts here
      • 2021-03-19 07854, 2021

      • _lucifer
        yeah :(
      • 2021-03-19 07834, 2021

      • antlarr has quit
      • 2021-03-19 07853, 2021

      • antlarr joined the channel
      • 2021-03-19 07805, 2021

      • _lucifer
        alastairp, considering all this what should we go ahead with for this PR?
      • 2021-03-19 07811, 2021

      • alastairp
        _lucifer: my points were: don't uselessly catch Exception, fix documentation, update output format, be consistent in user checks and string formatting
      • 2021-03-19 07817, 2021

      • alastairp
        you did the last 3?
      • 2021-03-19 07823, 2021

      • _lucifer
        yup
      • 2021-03-19 07834, 2021

      • alastairp
        and the first one turned up all of this issue around sentry
      • 2021-03-19 07843, 2021

      • _lucifer
        yes
      • 2021-03-19 07808, 2021

      • alastairp
        that can definitely be pushed to a separate issue. for now I don't mind if we leave the except Exception or if we remove the try/except
      • 2021-03-19 07834, 2021

      • alastairp
        if you've not deleted it yet, let's just leave it
      • 2021-03-19 07845, 2021

      • _lucifer
        ok let's leave it for now then
      • 2021-03-19 07811, 2021

      • _lucifer
        i'll open a ticket and let's get back to this once we have updated sentry
      • 2021-03-19 07835, 2021

      • alastairp
        perfect
      • 2021-03-19 07854, 2021

      • _lucifer
        thanks for the detailed discussion :D
      • 2021-03-19 07815, 2021

      • sumedh_p has quit
      • 2021-03-19 07853, 2021

      • BrainzGit
        [listenbrainz-server] MonkeyDo opened pull request #1352 (master…monkey-alert-notifications-refactor): Refactor alert notifications as higher-order component https://github.com/metabrainz/listenbrainz-server…
      • 2021-03-19 07804, 2021

      • Mr_Monkey
        Oh look alastairp ! Another big PR to review ^ ! Yay !
      • 2021-03-19 07830, 2021

      • Mr_Monkey
        (Refactoring the alerts as we discussed)
      • 2021-03-19 07805, 2021

      • adhi001 joined the channel
      • 2021-03-19 07833, 2021

      • c1e0_ is now known as c1e0
      • 2021-03-19 07812, 2021

      • sumedh joined the channel
      • 2021-03-19 07814, 2021

      • sumedh has quit
      • 2021-03-19 07833, 2021

      • c1e0_ joined the channel
      • 2021-03-19 07857, 2021

      • c1e0 has quit
      • 2021-03-19 07849, 2021

      • dpmittal joined the channel
      • 2021-03-19 07803, 2021

      • c1e0_ has quit
      • 2021-03-19 07836, 2021

      • c1e0_ joined the channel
      • 2021-03-19 07815, 2021

      • v6lur joined the channel
      • 2021-03-19 07836, 2021

      • BrainzGit
        [bookbrainz-site] MonkeyDo merged pull request #578 (master…collection-button): FIX(BB-591): Added margin to buttons on collections page https://github.com/bookbrainz/bookbrainz-site/pul…
      • 2021-03-19 07823, 2021

      • Mr_Monkey
        I deployed the latest version of PR #1320 on https://test.listenbrainz.org/feed
      • 2021-03-19 07819, 2021

      • travis-ci joined the channel
      • 2021-03-19 07819, 2021

      • travis-ci
        Project bookbrainz-site build #3758: failed in 9 min 21 sec: https://travis-ci.org/bookbrainz/bookbrainz-site/…
      • 2021-03-19 07819, 2021

      • travis-ci has left the channel
      • 2021-03-19 07844, 2021

      • adhi001
        on JIRA, do we close issues after a PR is merged or after the fix is deployed?
      • 2021-03-19 07858, 2021

      • c1e0_ has quit
      • 2021-03-19 07825, 2021

      • Mr_Monkey
        Usually after it is deployed
      • 2021-03-19 07815, 2021

      • adhi001
        Oh okay
      • 2021-03-19 07810, 2021

      • travis-ci joined the channel
      • 2021-03-19 07810, 2021

      • travis-ci
        Project bookbrainz-site build #3758: passed in 3 min 52 sec: https://travis-ci.org/bookbrainz/bookbrainz-site/…