h1k0n / codejam-commandline

Automatically exported from code.google.com/p/codejam-commandline
Apache License 2.0
0 stars 0 forks source link

Command line tools work for practice mode only #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

It seems that the scripts only work in practice mode for me.
$ ./gcj_download_input.py B small 0
$ ./gcj_get_status.py

What is the expected output? What do you see instead?

gcj_download_input.py always shows ServerError in competition mode (it works in 
practice mode though):

-------------------------------------------------------------------------------
Small input for "B - Space Emergency" at "source/B-small-0.in"
-------------------------------------------------------------------------------
Getting status of contest 1128486 from "code.google.com"...
200 OK, 71 bytes read from server (60 uncompressed).
Getting user status at contest 1128486 from "code.google.com"...
200 OK, 32 bytes read from server (12 uncompressed).
Downloading practice input file.
Getting input file "source/B-small-0.in" from "code.google.com"...
200 OK, 0 bytes read from server.
ServerError: No response received from the server. This generally happens when:
  - You try to download a small input but it is already solved.
  - You try to download the large input before solving the small input.
  - You try to redownload the large but its timer already expired.

gcj_get_status.py simply shows error messages:

Getting user status at contest 1128486 from "code.google.com"...
200 OK, 32 bytes read from server (12 uncompressed).
Getting events of contest 1128486 from "code.google.com"...
200 OK, 695 bytes read from server (1407 uncompressed).
Traceback (most recent call last):
  File "./gcj_get_status.py", line 171, in <module>
    main()
  File "./gcj_get_status.py", line 143, in main
    user_status.FixStatusWithSubmissions(status, submissions, input_spec)
  File "/home/svn/public/codejam/lib/user_status.py", line 240, in FixStatusWithSubmissions
    for problem_status in status.problem_inputs:
AttributeError: 'NoneType' object has no attribute 'problem_inputs'

What version of the product are you using? On what operating system?

$ python -V
Python 2.6.6

$ uname -a
FreeBSD cn1.leeym.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 
UTC 2011     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

Please provide any additional information below.

My account is 'leeym@leeym.com' which is not @gmail.com account. Not sure if it 
matters.

Original issue reported on code.google.com by leeym%le...@gtempaccount.com on 22 May 2011 at 11:17

GoogleCodeExporter commented 9 years ago
Thanks for the report. For the first one, do you enabled 2-factor 
authentication for your account? If that's the case, you will need to generate 
a one-time password for the commandline tool. The other reason is that you 
didn't qualified to round 1 or already qualified to round 2.

The second one is a bug revealed by the first issue, I have fix for that ready, 
it should be in the svn soon.

Can you try logging in using a one-time password? Here is a running contest for 
you to try: 
http://codejam-publictest.appspot.com/codejam/contest/dashboard?c=3009

Original comment by jor...@google.com on 23 May 2011 at 9:21

GoogleCodeExporter commented 9 years ago
No, I do not enable 2-factor authentication. Also I just passed Round 1C 
yesterday and the output I put in original description is what I got during 
Round 1C.

I can't download input from contest 3009 either.

$ ./gcj_download_input.py A small 0
-------------------------------------------------------------------------------
Small input for "A - Print 3.14159" at "source/A-small-0.in"
-------------------------------------------------------------------------------
Getting status of contest 3009 from "codejam-publictest.appspot.com"...
200 OK, 73 bytes read from server (63 uncompressed).
Getting user status at contest 3009 from "codejam-publictest.appspot.com"...
200 OK, 32 bytes read from server (12 uncompressed).
Downloading practice input file.
Getting input file "source/A-small-0.in" from 
"codejam-publictest.appspot.com"...
200 OK, 0 bytes read from server.
ServerError: No response received from the server. This generally happens when:
  - You try to download a small input but it is already solved.
  - You try to download the large input before solving the small input.
  - You try to redownload the large but its timer already expired.

Original comment by leeym%le...@gtempaccount.com on 23 May 2011 at 9:38

GoogleCodeExporter commented 9 years ago
Can you give me the output when you run ./gcj_init_contest.py? Also, a copy of 
your current_config file might be useful. Remember to remove the passwords and 
the cookie but not the middleware tokens, I need those (if you don't feel 
confortable sending them this way then send me an email with them).

Original comment by jor...@google.com on 23 May 2011 at 9:52

GoogleCodeExporter commented 9 years ago
Got your email, I will keep you updated this way.

Original comment by jor...@google.com on 23 May 2011 at 10:09

GoogleCodeExporter commented 9 years ago
Took a look at your tokens and there is a problem with them. Did you make any 
change to lib/google_login.py? I've seen this bug before and thought I got rid 
of it.

Original comment by jor...@google.com on 23 May 2011 at 10:24

GoogleCodeExporter commented 9 years ago
No, I didn't. I checked again and it's identical to the one in 
codejam-commandline-1.0-beta3.zip

$ wc google_login.py
     261    1177    9663 google_login.py

$ md5 google_login.py
MD5 (google_login.py) = c988150ab411c4f555fdc1f239efe043

Original comment by leeym%le...@gtempaccount.com on 23 May 2011 at 11:14

GoogleCodeExporter commented 9 years ago
To lib/code_jam_login.py? To any other file? If not, can you try changing 
'HOSTED_OR_GOOGLE' to 'HOSTED' in lib/code_jam_login.py:86? Can you give me the 
first 10 characters of the generated cookie?

Original comment by jor...@google.com on 23 May 2011 at 11:49

GoogleCodeExporter commented 9 years ago
I didn't change any *.py

I changed 'HOSTED_OR_GOOGLE' to 'HOSTED' in lib/code_jam_login.py:86 but it 
doesn't help.

The the generated cookie in config/current_config.py starts with 
'ACSID=AJKiYcGu8_H11jxcqCtdVB93UU2Bo.....'

Original comment by leeym%le...@gtempaccount.com on 24 May 2011 at 12:24

GoogleCodeExporter commented 9 years ago
It has the same effects as the previous bug but because of different causes. 
Can you try with an @gmail.com account to see if the problem is specific to 
your account? Did you put any special configuration in your domain that 
restricts the login procedures to a few? The tool uses ClientLogin which is 
pretty old.

Original comment by jor...@google.com on 24 May 2011 at 1:41

GoogleCodeExporter commented 9 years ago
Too bad I don't have an @gmail.com account, and I don't put any special 
configuration in my domain either.

Is it a problem for all non-@gmail.com accounts?

Original comment by leeym%le...@gtempaccount.com on 24 May 2011 at 1:50

GoogleCodeExporter commented 9 years ago
I somehow "fixed" it by replacing 'HOSTED_OR_GOOGLE' to 'GOOGLE'.

Now I believe it's my problem since that I have two identical accounts, one is 
'leeym@leeym.com' for Google and one is 'leeym' in '@leeym.com' domain for 
Google Apps.

$ ./gcj_download_input.py A small 0
-------------------------------------------------------------------------------
Small input for "A - Print 3.14159" at "source/A-small-0.in"
-------------------------------------------------------------------------------
Getting status of contest 3009 from "codejam-publictest.appspot.com"...
200 OK, 73 bytes read from server (62 uncompressed).
Getting user status at contest 3009 from "codejam-publictest.appspot.com"...
200 OK, 73 bytes read from server (141 uncompressed).
You will have 4 minutes to submit your answer for A-small. Download? (y/N) y
Downloading new input file.
Getting input file "source/A-small-0.in" from 
"codejam-publictest.appspot.com"...
200 OK, 51 bytes read from server (6000 uncompressed).
File "source/A-small-0.in" downloaded successfully.

It will be great to make it configurable with through command line parameters 
or in config files.

Thanks!

Original comment by leeym%le...@gtempaccount.com on 24 May 2011 at 6:16

GoogleCodeExporter commented 9 years ago
That's awesome news! Looks like the server somehow got confused and didn't 
recognize your login successfully. I'll implement an extra option for the 
initialize and renew scripts to specify the account type.

Original comment by jor...@google.com on 24 May 2011 at 6:54

GoogleCodeExporter commented 9 years ago
Not sure if I might have this ready for the next version, but I was thinking 
and it makes more sense to have it as a configuration value than an option.

Original comment by jor...@google.com on 24 May 2011 at 10:36

GoogleCodeExporter commented 9 years ago

Original comment by jor...@google.com on 24 May 2011 at 11:05