Kodi Community Forum
Weatherbit.io - Invalid argument - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Weather Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=155)
+---- Thread: Weatherbit.io - Invalid argument (/showthread.php?tid=356344)



Weatherbit.io - Invalid argument - smutel - 2020-08-10

Hello,

After installing weatherbit.io, I received the error message below:
Code:

020-08-10 20:07:46.013 T:2386   ERROR: Exception in thread Thread-2:
                                            Traceback (most recent call last):
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/threading.py", line 801, in __bootstrap_inner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 189, in run
                                                self.merge_tiles()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 250, in merge_tiles
                                                out.paste( tile, (imx, imy), tile.convert('RGBA') )
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/Image.py", line 833, in convert
                                                self.load()
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/ImageFile.py", line 195, in load
                                                seek(o)
                                            IOError: [Errno 22] Invalid argument
2020-08-10 20:07:46.018 T:2382   ERROR: Exception in thread Thread-1:
                                            Traceback (most recent call last):
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/threading.py", line 801, in __bootstrap_inner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 189, in run
                                                self.merge_tiles()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 250, in merge_tiles
                                                out.paste( tile, (imx, imy), tile.convert('RGBA') )
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/Image.py", line 833, in convert
                                                self.load()
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/ImageFile.py", line 195, in load
                                                seek(o)
                                            IOError: [Errno 22] Invalid argument
2020-08-10 20:07:46.230 T:2391   ERROR: Exception in thread Thread-5:
                                            Traceback (most recent call last):
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/threading.py", line 801, in __bootstrap_inner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 189, in run
                                                self.merge_tiles()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 250, in merge_tiles
                                                out.paste( tile, (imx, imy), tile.convert('RGBA') )
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/Image.py", line 833, in convert
                                                self.load()
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/ImageFile.py", line 195, in load
                                                seek(o)
                                            IOError: [Errno 22] Invalid argument



RE: Weatherbit.io - Invalid argument - mainlyQLockUser - 2020-12-31

(2020-08-10, 20:35)smutel Wrote: Hello,

After installing weatherbit.io, I received the error message below:
Code:

020-08-10 20:07:46.013 T:2386   ERROR: Exception in thread Thread-2:
                                            Traceback (most recent call last):
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/threading.py", line 801, in __bootstrap_inner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 189, in run
                                                self.merge_tiles()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 250, in merge_tiles
                                                out.paste( tile, (imx, imy), tile.convert('RGBA') )
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/Image.py", line 833, in convert
                                                self.load()
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/ImageFile.py", line 195, in load
                                                seek(o)
                                            IOError: [Errno 22] Invalid argument
2020-08-10 20:07:46.018 T:2382   ERROR: Exception in thread Thread-1:
                                            Traceback (most recent call last):
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/threading.py", line 801, in __bootstrap_inner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 189, in run
                                                self.merge_tiles()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 250, in merge_tiles
                                                out.paste( tile, (imx, imy), tile.convert('RGBA') )
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/Image.py", line 833, in convert
                                                self.load()
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/ImageFile.py", line 195, in load
                                                seek(o)
                                            IOError: [Errno 22] Invalid argument
2020-08-10 20:07:46.230 T:2391   ERROR: Exception in thread Thread-5:
                                            Traceback (most recent call last):
                                              File "/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends/arm-linux-androideabi-21-release/lib/python2.7/threading.py", line 801, in __bootstrap_inner
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 189, in run
                                                self.merge_tiles()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py", line 250, in merge_tiles
                                                out.paste( tile, (imx, imy), tile.convert('RGBA') )
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/Image.py", line 833, in convert
                                                self.load()
                                              File "/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/ImageFile.py", line 195, in load
                                                seek(o)
                                            IOError: [Errno 22] Invalid argument
 I had the same error but with slightly different system. I use Kodi Leia 18.9 with playstore date 25.10.2020 together with openweathermap addon 5.02 on an android 9.0 device (S85, by the way with improvable Wifi). The error was also thrown like you had it in the ImageFile.py part of the PIL/Pillow Library. I searched a lot, because I knew in former times it was working. The error happens during the tiling of the images. It seems that the seek command does not work or the seek command is tried to be done on a stream but it is a file. I do not know exactly. But what I found out how to get it to work was first commenting out the seek(o) line with a "#" hash sign in the file mentioned above.

This looks like this then
/data/data/org.xbmc.kodi/cache/apk/assets/addons/script.module.pil/lib/PIL/ImageFile.py
...
line 193        for d, e, o, a in self.tile:
line 194            d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
line 195            #seek(o)
line 196            try:
line 197                d.setimage(self.im, e)
...

Second I changed the path of all the map files which are downloaded and generated by the openweathermap addon. I did this by changing the path in the beginning of this file:
/sdcard/Android/data/org.xbmc.kodi/files/.kodi/addons/script.openweathermap.maps/default.py

line 19 PROFILE      = xbmc.translatePath(ADDON.getAddonInfo('profile')).decode('utf-8')
line 20 PROFILE = "/sdcard/Download/"

And then voila, all maps are back again on the "today" screen of the weather addon. This is for sure not a perfect and even not universal solution. I still hope to give a hint how to solve this problem individually. Maybe you find similar python code in your case.