I think it has to be `%s`, so that it doesn't get quotes in it. With `%s`, the command we execute on the engine is something like `label_state(distarray_12345)`, where `distarray_12345` is the name of a variable that exists, whereas with `%r` we try and execute `label_state('distarray_12345')` and then somebody starts trying to get attributes of a string instead of the expected object type.