Results 3 comments of mhyst

Did you login before? Can you paste more complete code? What is happening there is that "m" is an integer instead of a Message object. Integers don't have add_label method....

try adding m.fetch() in the loop before add_label is called. Perhaps just the prefetch has failed.