VWsFriend
VWsFriend copied to clipboard
Error Starting Container "ValueError: cannot add non-opaque RGBA color to RGB palette"
Description:
I encountered an issue when starting the docker-compose system using the latest version. The error occurs during the update process of vehicle data. The Server Process then stops responding.
Error Log:
The following traceback is observed in the log file:
Traceback (most recent call last): File "/opt/venv/bin/vwsfriend", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/venv/lib/python3.12/site-packages/vwsfriend/vwsfriend_base.py", line 519, in main weConnect.update(updateCapabilities=True, updatePictures=True, force=True, selective=[Domain.ACCESS, File "/opt/venv/lib/python3.12/site-packages/weconnect/weconnect.py", line 194, in update self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective) File "/opt/venv/lib/python3.12/site-packages/weconnect/weconnect.py", line 216, in updateVehicles vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict, fixAPI=self.fixAPI, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/weconnect/elements/vehicle.py", line 132, in __init__ self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures, selective=selective) File "/opt/venv/lib/python3.12/site-packages/weconnect/elements/vehicle.py", line 233, in update self.updatePictures() File "/opt/venv/lib/python3.12/site-packages/weconnect/elements/vehicle.py", line 492, in updatePictures self.updateStatusPicture() File "/opt/venv/lib/python3.12/site-packages/weconnect/elements/vehicle.py", line 624, in updateStatusPicture draw.ellipse(((imgWidth - 100), warningLightoffset, (imgWidth - 1), (warningLightoffset + 100)), fill=(0, 0, 0, 200)) File "/opt/venv/lib/python3.12/site-packages/PIL/ImageDraw.py", line 171, in ellipse ink, fill = self._getink(outline, fill) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/PIL/ImageDraw.py", line 142, in _getink fill = self.palette.getcolor(fill, self._image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/PIL/ImagePalette.py", line 118, in getcolor raise ValueError(msg) ValueError: cannot add non-opaque RGBA color to RGB palette
Vehicle Information:
The vehicle is a VW ID.5.
Potential Fix:
I found a temporary solution by modifying the vehicle.py file in the weconnect package. The change involves converting an image to RGBA format to handle badge rendering. Specifically, the following lines need to be added around line 609 in vehicle.py:
patching /opt/venv/lib/python3.12/site-packages/weconnect/elements/vehicle.py at row 609
imgWithBadges = img.copy()
imgWithBadges = imgWithBadges.convert("RGBA") // Adding thins part to convert Badge to RGBA
badgeoffset = 0
Reason for the Issue:
I suspect the issue may be related to certain error messages or badge renderings that are not properly handled for my specific vehicle model. Unfortunately, I currently do not have the time to set up a full development environment to investigate this further or to debug it in depth.