Started getting errors - balena.exceptions.RequestError: b'Unauthorized'

Hi,
I’m using the connector Balenablock. Recently I changed the image location to bh.cr/balenalabs/connector-aarch64 from balenablocks/connector:raspberrypi4-64. Unfortunately there was a problem with this image resulting in an ModuleNotFound Errors (I made a post about this on the forum and it seems this is a known problem indicated in the GitHub repo).

No problem I thought, I just changed the image location back to balenablocks/connector:raspberrypi4-64 and did a push up to my fleet which all seemed to work.

However now I’m getting the following rather strange error which I’m not convinced is entirely related just to the connector block. I’ve never seen this before and don’t see that I’ve changed anything my end.

22.11.22 21:24:09 (+0000)  connector  balenaBlocks connector version: 1.1.2
22.11.22 21:24:09 (+0000)  connector  Changing hostname to ec1db25
22.11.22 21:24:09 (+0000)  connector  Generating config
22.11.22 21:24:09 (+0000)  dashboard  Interim dashboard sync skipped: No schema found.
22.11.22 21:24:09 (+0000)  influxdb  [httpd] 172.17.0.5 - - [22/Nov/2022:21:24:09 +0000] "GET /query?db=balena&q=show+field+keys HTTP/1.1" 200 70 "-" "Python-urllib/3.9" 007211f3-6aac-11ed-804d-0242ac110003 865
22.11.22 21:24:11 (+0000)  connector  balenablocks/connector
22.11.22 21:24:11 (+0000)  connector  ----------------------
22.11.22 21:24:11 (+0000)  connector  Intelligently connecting data sources with data sinks
22.11.22 21:24:12 (+0000)  connector  Traceback (most recent call last):
22.11.22 21:24:12 (+0000)  connector    File "/app/./autowire.py", line 96, in <module>
22.11.22 21:24:12 (+0000)  connector      config = autowire.GetConfig()
22.11.22 21:24:12 (+0000)  connector    File "/app/./autowire.py", line 62, in GetConfig
22.11.22 21:24:12 (+0000)  connector      services = self.GetServices()
22.11.22 21:24:12 (+0000)  connector    File "/app/./autowire.py", line 33, in GetServices
22.11.22 21:24:12 (+0000)  connector      device = self.balena.models.device.get_with_service_details(device_id, True)
22.11.22 21:24:12 (+0000)  connector    File "/root/.local/lib/python3.9/site-packages/balena/models/device.py", line 309, in get_with_service_details
22.11.22 21:24:12 (+0000)  connector      raw_data = self.base_request.request(
22.11.22 21:24:12 (+0000)  connector    File "/root/.local/lib/python3.9/site-packages/balena/base_request.py", line 197, in request
22.11.22 21:24:12 (+0000)  connector      raise exceptions.RequestError(response._content)
22.11.22 21:24:12 (+0000)  connector  balena.exceptions.RequestError: b'Unauthorized'
22.11.22 21:24:14 (+0000) Service exited 'connector sha256:3652f9a3f1dc9dd7253dba82b9fac518f78ccd1c874d95c1c25cbc6d190f6768'

I tried creating a new fleet, creating a new device, trying a previous OS version, all to no avail. I even powered up a device in this fleet that I know was working fine and was pinned to a working release but even this is now showing this error!

Does anybody have any ideas what might be causing this or anything I can try?

Many thanks
Mark.

I’m wondering if this error means that the ‘connector’ is not able to get data from my sensor which makes its data available on port 7575 (as per connectors requirements) and yet I haven’t made any changes to the sensor code… very strange.

Phew looks like a fixed this. In case anybody comes across in a search in the future - I went back to a clean slate, created a new project in PyCharm using my main branch code, setup a new fleet and went back to Python 3.7 images. No errors now, everything is working.

So at the moment I’m not quite sure what caused this but I’ll keeping a close eye on things as I move forward now to see if I can isolate the cause. I’ll update here once I can be certain.