Service Temporarily Unavailable (QT code 301, HTTP code 200)

I’m deveIoping a “Classical Workparts” plugin for Picard, which gets the “parent” works for a given recording by using XML lookups. I seem to be getting a lot of these “unavailable” responses in the last few days when doing these XML lookups via Picard. About 10% of the time. Until recently I was having no such problems. If I do a “refresh” it will sometimes pick up the missing data and sometimes just hang and I have to terminate the app. Any ideas what might be causing this and what to do about it? Also, any way I can find out what is causing the app to stop responding?

Have you implemented code in plugin to ensure you don’t hit the MusicBrainz request rate limit. The problem with MuisicBrainz apis is you cannot get the hierachy of works linked to a recording as part of getting a recording so it becomes very expensive to get this type of infomation in a timely way.

Picard automatically builds in a 1 second delay. I can see that happening correctly in the log.

Sort of fixed by adding a re-try loop (with a max number of re-tries). But if I can understand how to avoid/minimise the problem, that would be better.

Can you give an example request you are making? Other than that this is likely the MB server having issues, I also had some of those Service Temporarely Unavailable messages today while tagging some files. Someone from the server team can probably tell more.

return album.tagger.xmlws.get(host, port, path,
partial(self.work_process, part_level, workId, tries),
xml=True, priority=True, important=False,

:slight_smile: I meant the URL for the request

Aw. I thought you were just checking that I was using the XMLwebservice.
The URLs causing errors were many and various.
This is a great album for testing purposes:
Yesterday it was resulting in numerous lookup errors, but for different lookups each time. I added a re-try loop (max 6 lookups) and most of the works were found eventually - only one exceeded the max. I ran it again this morning and there were no errors at all. In fact I haven’t received any error messages at all today, so maybe it was a temporary server issue.
The plugin (development version) can be found at
I am still getting the problem with Picard hanging sometimes (last debug line = “WSREQ: Last request to (u’’, 80) was 1001 ms ago, starting another one”). It may be that this is a problem with the plugin, but it only happens on certain releases - usually towards the end of the album lookups. This one - - just caused a hang like that.
This one, which I entered a few days ago and was fine at first, - - was causing multiple errors yesterday but none today. However, it is still hanging as described above.

Errors occurring again this evening, for example:
E: 19:22:39 Network request error for Error downloading - server replied: Service Temporarily Unavailable (QT code 301, HTTP code 200)

I’m not sure how much it helps, but we do have a ticket about HTTP code 200 being logged on some Service Temporary Unavailable responses:

The re-try loop seems to cater for 99% of situations. I think I found the cause of the “hanging”. I have a recursive call in my code which works fine in Python, but not always in Picard. If I limit the recursion depth to 16 then it seems to work. (BTW it is not infinitely recursive and limiting the depth to a greater number, say 32, seems not to work). Curious.