07-28-2024 07:52 AM
We are in the middle of a migration from on-prem CUCM to Webex. We are trying to migrate Jabber Chat Room content to Webex. We are using this script:
gve-sw/GVE_DevNet_Jabber_MigrateRooms-ChatToWebex (github.com)
When we run it as a test (reading data but not creating in Webex) it bombs out in the same place every time. A specific chat room and the last message displayed before the Traceback is always the same.
It's a UnicodeDecodeError. See below.
We're assuming the script is reading something in a chat message it doesn't like or can't convert. We're trying to get past this error. We'd even be fine if there is some loss of data as long as the majority of it migrates over. Has anyone run this script and encountered this problem? If so, how did you resolve it?
Thanks,
Jim Makowski
Traceback (most recent call last):
File ~\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File c:\temp\gve_devnet_jabber_migraterooms-chattowebex-master\main.py:806
main()
File c:\temp\gve_devnet_jabber_migraterooms-chattowebex-master\main.py:241 in main
for j_msg in jabber_messages:
File ~\AppData\Local\Continuum\Anaconda3\lib\site-packages\sqlalchemy\engine\result.py:1010 in __iter__
row = self.fetchone()
File ~\AppData\Local\Continuum\Anaconda3\lib\site-packages\sqlalchemy\engine\result.py:1343 in fetchone
self.connection._handle_dbapi_exception(
File ~\AppData\Local\Continuum\Anaconda3\lib\site-packages\sqlalchemy\engine\base.py:1514 in _handle_dbapi_exception
util.raise_(exc_info[1], with_traceback=exc_info[2])
File ~\AppData\Local\Continuum\Anaconda3\lib\site-packages\sqlalchemy\util\compat.py:182 in raise_
raise exception
File ~\AppData\Local\Continuum\Anaconda3\lib\site-packages\sqlalchemy\engine\result.py:1336 in fetchone
row = self._fetchone_impl()
File ~\AppData\Local\Continuum\Anaconda3\lib\site-packages\sqlalchemy\engine\result.py:1215 in _fetchone_impl
return self.cursor.fetchone()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 47: ordinal not in range(128)
07-28-2024 11:25 PM
Why don't you ask this question in the DevNET forum? There is a specific forum for that...
Moved your post.
07-29-2024 03:44 AM
@JJMakowski i dont know for sure, but looking at your errors, if you modify the config.py file to include the encoding when connecting to the database, i wonder if this will solve it? Try adding the encoding parameter to the create_engine function, that might be it?
Otherwise i would open an issue on the repo and hopefully one of the maintainers will be able to help here. I also see two emails on the readme, which you might be able to get direct support from?
Hope this helps.
07-29-2024 04:01 AM
@JJMakowski Maybe the following stackoverflow post helps?
https://stackoverflow.com/questions/11972363/sqlalchemy-and-unicodedecodeerror
I have solved the issue. The title column was being returned by SQLAlchemy as a str and not Unicode. I thought adding encoding='utf8' as an argument to create_engine would take care of this, however, the right way to do it is to pass it in the database URI: mysql://me@myserver/mydatabase?charset=utf8 .
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide