When bot_config.py imports google.protobuf, it unconditionally gets the one embedded in the bot's version due to the bot's sys.path manipulation.
This causes problems because "from google" nows has a limited view of the packages in the bot, instead of whatever is installed in the running swarming bot environment.
https://chromium.googlesource.com/infra/luci/luci-py/+/master/appengine/swarming/server/bot_archive.py#163
I'm unsure how to fix that. Options:
#1 issue 638071 by simply having bot_config run out of process, thus has its own clean sys.path
#2 after bot's initialization but before importing bot_config, try to "revert" sys.path. The use of api.os_utilities and api.platforms.* needs to be kept but they can be preemptively imported which should work around the problem.
#3 workaround: have bot_config hack sys.path by itself
#1 is really the long term fix but it's non-trivial to implement. Since Michael is immediately affected by this I'd like to see if #2 is doable. Otherwise Michael shall do #3 for now. Any other idea?
Comment 1 by bugdroid1@chromium.org
, Aug 24 2017