Problem importing dump created by 1.3.2 into 1.4.rc1

22 views
Skip to first unread message

Madhavan Mukund

unread,
Dec 22, 2018, 11:10:48 PM12/22/18
to contestm...@googlegroups.com
I am trying to migrate my CMS installation from 1.3.2 to 1.4.rc1. I
created a dump from 1.3.2. Both DumpImporter and DumpUpdater on
1.4.rc1 complain as follows (see detailed output below):

TypeError: the JSON object must be str, not 'bytes'

I am able to reimport the same dump in 1.3.2 (I imported the dump into
a fresh 1.3.2 installation on a different machine).

--Madhavan

P.S. I am running these CMS instances using virtualenv.

======================================================================

$ ./cmscontrib/DumpImporter.py ~/cms-dump-2018-12-22-0725/
2018-12-23 09:37:18,642 - INFO [<unknown>] Using configuration file ./config/cms.conf.
2018-12-23 09:37:19,123 - INFO [<unknown>] Starting import.
2018-12-23 09:37:19,124 - INFO [<unknown>] Importing the contest from a JSON file.
Traceback (most recent call last):
File "./cmscontrib/DumpImporter.py", line 508, in <module>
sys.exit(main())
File "./cmscontrib/DumpImporter.py", line 503, in main
success = importer.do_import()
File "./cmscontrib/DumpImporter.py", line 200, in do_import
self.datas = json.load(fin)
File "/usr/lib/python3.5/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

$ ./cmscontrib/DumpUpdater.py ~/cms-dump-2018-12-22-0725/
2018-12-23 09:36:55,496 - INFO [<unknown>] Using configuration file ./config/cms.conf.
Traceback (most recent call last):
File "./cmscontrib/DumpUpdater.py", line 166, in <module>
sys.exit(main())
File "./cmscontrib/DumpUpdater.py", line 105, in main
data = json.load(fin)
File "/usr/lib/python3.5/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

======================================================================
signature.asc

Cristian Consonni

unread,
Dec 24, 2018, 3:38:20 PM12/24/18
to contestm...@googlegroups.com
On 23/12/18 05:10, Madhavan Mukund wrote:
> I am trying to migrate my CMS installation from 1.3.2 to 1.4.rc1. I
> created a dump from 1.3.2. Both DumpImporter and DumpUpdater on
> 1.4.rc1 complain as follows (see detailed output below):
>
> TypeError: the JSON object must be str, not 'bytes'
>
> I am able to reimport the same dump in 1.3.2 (I imported the dump into
> a fresh 1.3.2 installation on a different machine).

This is a typical error when mixing Python 2 and Python 3, can you check
if are your virtualenvs both Python 3?


Cristian

--
Cristian Consonni
PhD student, DISI - University of Trento

signature.asc

Madhavan Mukund

unread,
Feb 25, 2019, 11:52:29 AM2/25/19
to contestm...@googlegroups.com
I am still facing the problem I sent in my earlier mail (Dec 2018)
regarding importing a 1.3.2 dump into 1.4.rc1.

Today, I created an empty contest on a fresh 1.4.rc1 database via the
AdminServer. When I try to access the main Contest page, I get the
following error message:

A critical error has occurred :-(

On the Admin webpage, it says "Call to service failed" for all
services. A screenshot is here:

https://www.dropbox.com/s/gikmoa0343ecvpy/cms-contest-admin.png?dl=0

Under cmsLogService, I see the following messages when I try to
connect to the main Contest page.

2019-02-25 22:15:17,511 - ERROR [Contest,0] Uncaught exception (ValueError("Invalid cookie 'NPTEL DAA Spring 2019_login': ''",)) while processing a request: Traceback (most recent call last):
File "/home/madhavan/cms_venv3/lib/python3.5/site-packages/tornado/web.py", line 1489, in _execute
result = self.prepare()
File "/home/madhavan/cms_venv3/lib/python3.5/site-packages/cms-1.4rc1-py3.5.egg/cms/server/contest/handlers/contest.py", line 97, in prepare
self.r_params = self.render_params()
File "/home/madhavan/cms_venv3/lib/python3.5/site-packages/cms-1.4rc1-py3.5.egg/cms/server/contest/handlers/contest.py", line 187, in render_params
if self.current_user is not None:
File "/home/madhavan/cms_venv3/lib/python3.5/site-packages/tornado/web.py", line 1158, in current_user
self._current_user = self.get_current_user()
File "/home/madhavan/cms_venv3/lib/python3.5/site-packages/cms-1.4rc1-py3.5.egg/cms/server/contest/handlers/contest.py", line 167, in get_current_user
self.clear_cookie(cookie_name)
File "/home/madhavan/cms_venv3/lib/python3.5/site-packages/tornado/web.py", line 580, in clear_cookie
domain=domain)
File "/home/madhavan/cms_venv3/lib/python3.5/site-packages/tornado/web.py", line 543, in set_cookie
raise ValueError("Invalid cookie %r: %r" % (name, value))
ValueError: Invalid cookie 'NPTEL DAA Spring 2019_login': ''

Can you debug what the problem may be? I've not yet got 1.4rc1
running. 1.3.2 works quite fine. I can switch back to 1.3.2, but I
would like to have Python3 available as a language.

--Madhavan
signature.asc

Madhavan Mukund

unread,
Feb 25, 2019, 12:03:06 PM2/25/19
to contestm...@googlegroups.com
I see now that I am using Python 3.5 (the default on Debian 9 Stable)
and I need at least 3.6. So I will try to install Python >= 3.6 and
try again before bothering you.

--Madhavan
signature.asc
Reply all
Reply to author
Forward
0 new messages