Hi guys
We were running domjudge version 4.0 on Ubuntu 12.04, and over the weekend decided to upgrade 5.1. (I’m not the original maintainer, he has graduated from our institute). So the database upgrade scripts ran mostly fine. I had to change the shortname column fill line (in 4.0 -> 5.0) UPDATE `contest` SET `shortname` = CONCAT(`cid`, UPPER(SUBSTR(REPLACE(`name`, ' ', ''), 1, 10))), `public` = 1; since previous version did not generate unique value for contests with long common prefix. Further I commented out the line to upgrade to support full unicode (in 5.0 -> 5.1) because it refers to a file that I couldn’t find, and gave an error. So after this DB upgrade was complete.
Now for Apache conf, since we are still on 2.2, I didn’t find the a2enconf, and found in /etc/apache2/conf.d a symlink to the previous apache.conf. So I updated the symlink, and then commented out the apache2.4 parts of the new file. Is there something else I need to do?
Because when I run, I get 500s in the web browser. I also tried to look at the apache log file, and I got these errors Sun May 29 11:23:10 2016] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.23 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations [Sun May 29 11:23:17 2016] [error] [client 192.168.1.99] File does not exist: /var/www/contest [Sun May 29 11:23:19 2016] [error] [client 192.168.1.99] PHP Parse error: syntax error, unexpected '[' in /home/foobar/domjudge5.1/domserver/lib/www/print.php on line 126
Could you please advise on how to fix? I have a backup of the database from the 4.0 install, so I can even start the process again if I did something wrong earlier, but I would prefer not to do that since the backup is ~100 GB (because of large number of submissions).
Thank you Parth Mittal
Okay, so the problem is that the line does something like explode(args…)[1], which PHP does not support apparently. So I replaced with a temp variable for the return of explode, and then indexed it in the next line to get it to work. Had to do this in the file checker.jury.php too.
Thanks
On 29-May-2016, at 11:36 AM, Parth Mittal parth15069@iiitd.ac.in wrote:
Hi guys
We were running domjudge version 4.0 on Ubuntu 12.04, and over the weekend decided to upgrade 5.1. (I’m not the original maintainer, he has graduated from our institute). So the database upgrade scripts ran mostly fine. I had to change the shortname column fill line (in 4.0 -> 5.0) UPDATE `contest` SET `shortname` = CONCAT(`cid`, UPPER(SUBSTR(REPLACE(`name`, ' ', ''), 1, 10))), `public` = 1; since previous version did not generate unique value for contests with long common prefix. Further I commented out the line to upgrade to support full unicode (in 5.0 -> 5.1) because it refers to a file that I couldn’t find, and gave an error. So after this DB upgrade was complete.
Now for Apache conf, since we are still on 2.2, I didn’t find the a2enconf, and found in /etc/apache2/conf.d a symlink to the previous apache.conf. So I updated the symlink, and then commented out the apache2.4 parts of the new file. Is there something else I need to do?
Because when I run, I get 500s in the web browser. I also tried to look at the apache log file, and I got these errors Sun May 29 11:23:10 2016] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.23 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations [Sun May 29 11:23:17 2016] [error] [client 192.168.1.99] File does not exist: /var/www/contest [Sun May 29 11:23:19 2016] [error] [client 192.168.1.99] PHP Parse error: syntax error, unexpected '[' in /home/foobar/domjudge5.1/domserver/lib/www/print.php on line 126
Could you please advise on how to fix? I have a backup of the database from the 4.0 install, so I can even start the process again if I did something wrong earlier, but I would prefer not to do that since the backup is ~100 GB (because of large number of submissions).
Thank you Parth Mittal _______________________________________________ DOMjudge-devel mailing list DOMjudge-devel@domjudge.org https://www.domjudge.org/mailman/listinfo/domjudge-devel
Hi Parth,
On 29-05-16 03:06, Parth Mittal wrote:
Hi guys
We were running domjudge version 4.0 on Ubuntu 12.04, and over the weekend decided to upgrade 5.1. (I’m not the original maintainer, he has graduated from our institute). So the database upgrade scripts ran mostly fine. I had to change the shortname column fill line (in 4.0 -> 5.0) UPDATE `contest` SET `shortname` = CONCAT(`cid`, UPPER(SUBSTR(REPLACE(`name`, ' ', ''), 1, 10))), `public` = 1; since previous version did not generate unique value for contests with long common prefix.
Ok, the upgrade scripts have indeed not been written to cope with all possible things, especially when updating the data.
Further I commented out the line to upgrade to support full unicode (in 5.0 -> 5.1) because it refers to a file that I couldn’t find, and gave an error. So after this DB upgrade was complete.
Ah, the file is available in the source tree under sql/upgrade/convert_to_utf8mb4_5.0.sql but is not installed.
I've fixed that now, should be in the next point release. Note that this won't automatically be upgraded anymore when you're already on 5.1. This is not a crucial upgrade if you're happy to only use UTF-8 characters with of 3 or less bytes encoding length, but then you should edit etc/domserver-config.php and modify DJ_CHARACTER_SET_MYSQL and DJ_MYSQL_COLLATION accordingly.
Now for Apache conf, since we are still on 2.2, I didn’t find the a2enconf, and found in /etc/apache2/conf.d a symlink to the previous apache.conf. So I updated the symlink, and then commented out the apache2.4 parts of the new file. Is there something else I need to do?
Because when I run, I get 500s in the web browser. I also tried to look at the apache log file, and I got these errors Sun May 29 11:23:10 2016] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.23 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations [Sun May 29 11:23:17 2016] [error] [client 192.168.1.99] File does not exist: /var/www/contest
Is /var/www/contest possibly a dead symlink to the previous installation? With the default apache.conf snippet this should not be required, though. Did you modify the apache.conf snippet other than changing from Apache 2.4 to 2.2 syntax?
[Sun May 29 11:23:19 2016] [error] [client 192.168.1.99] PHP Parse error: syntax error, unexpected '[' in /home/foobar/domjudge5.1/domserver/lib/www/print.php on line 126
Ah, there we array index the return value of a function, explode(). This is only supported since PHP >= 5.4. I assume you are running a lower version? You may want to upgrade then: although this is fixable with a workaround via indirect assignment, there are a few other places in the code where PHP >= 5.4 is assumed.
Could you please advise on how to fix? I have a backup of the database from the 4.0 install, so I can even start the process again if I did something wrong earlier, but I would prefer not to do that since the backup is ~100 GB (because of large number of submissions).
If you can live with the UTF-8 issue, then there should be no need to restart the SQL upgrade.
I hope this helps.
Jaap
Thank you for thq quick response.
Further I commented out the line to upgrade to support full unicode (in 5.0 -> 5.1) because it refers to a file that I couldn’t find, and gave an error. So after this DB upgrade was complete.
Ah, the file is available in the source tree under sql/upgrade/convert_to_utf8mb4_5.0.sql but is not installed.
I've fixed that now, should be in the next point release. Note that this won't automatically be upgraded anymore when you're already on 5.1. This is not a crucial upgrade if you're happy to only use UTF-8 characters with of 3 or less bytes encoding length, but then you should edit etc/domserver-config.php and modify DJ_CHARACTER_SET_MYSQL and DJ_MYSQL_COLLATION accordingly.
Can I instead just run convert_to_utf8mb5_5.0.sql? (As in, is this safe to run out of order like this)
Now for Apache conf, since we are still on 2.2, I didn’t find the a2enconf, and found in /etc/apache2/conf.d a symlink to the previous apache.conf. So I updated the symlink, and then commented out the apache2.4 parts of the new file. Is there something else I need to do?
Because when I run, I get 500s in the web browser. I also tried to look at the apache log file, and I got these errors Sun May 29 11:23:10 2016] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.23 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations [Sun May 29 11:23:17 2016] [error] [client 192.168.1.99] File does not exist: /var/www/contest
Is /var/www/contest possibly a dead symlink to the previous installation? With the default apache.conf snippet this should not be required, though. Did you modify the apache.conf snippet other than changing from Apache 2.4 to 2.2 syntax?
We changed the aliases on top because we used a slightly different URL, but these errors seem to have disappeared now, without further change to the conf file.
[Sun May 29 11:23:19 2016] [error] [client 192.168.1.99] PHP Parse error: syntax error, unexpected '[' in /home/foobar/domjudge5.1/domserver/lib/www/print.php on line 126
Ah, there we array index the return value of a function, explode(). This is only supported since PHP >= 5.4. I assume you are running a lower version? You may want to upgrade then: although this is fixable with a workaround via indirect assignment, there are a few other places in the code where PHP >= 5.4 is assumed.
I have now upgraded to PHP 5.4, it works now.
Thank you Parth Mittal
On 29-05-16 10:46, Parth Mittal wrote:
Thank you for thq quick response.
Further I commented out the line to upgrade to support full unicode (in 5.0 -> 5.1) because it refers to a file that I couldn’t find, and gave an error. So after this DB upgrade was complete.
Ah, the file is available in the source tree under sql/upgrade/convert_to_utf8mb4_5.0.sql but is not installed.
I've fixed that now, should be in the next point release. Note that this won't automatically be upgraded anymore when you're already on 5.1. This is not a crucial upgrade if you're happy to only use UTF-8 characters with of 3 or less bytes encoding length, but then you should edit etc/domserver-config.php and modify DJ_CHARACTER_SET_MYSQL and DJ_MYSQL_COLLATION accordingly.
Can I instead just run convert_to_utf8mb5_5.0.sql? (As in, is this safe to run out of order like this)
No, that won't work because the script explicitly updates all relevant table fields.
You could manually do the update: simply look what the script does and repeat that for all tables and text-like fields inside all tables.
Now for Apache conf, since we are still on 2.2, I didn’t find the a2enconf, and found in /etc/apache2/conf.d a symlink to the previous apache.conf. So I updated the symlink, and then commented out the apache2.4 parts of the new file. Is there something else I need to do?
Because when I run, I get 500s in the web browser. I also tried to look at the apache log file, and I got these errors Sun May 29 11:23:10 2016] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.23 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations [Sun May 29 11:23:17 2016] [error] [client 192.168.1.99] File does not exist: /var/www/contest
Is /var/www/contest possibly a dead symlink to the previous installation? With the default apache.conf snippet this should not be required, though. Did you modify the apache.conf snippet other than changing from Apache 2.4 to 2.2 syntax?
We changed the aliases on top because we used a slightly different URL, but these errors seem to have disappeared now, without further change to the conf file.
[Sun May 29 11:23:19 2016] [error] [client 192.168.1.99] PHP Parse error: syntax error, unexpected '[' in /home/foobar/domjudge5.1/domserver/lib/www/print.php on line 126
Ah, there we array index the return value of a function, explode(). This is only supported since PHP >= 5.4. I assume you are running a lower version? You may want to upgrade then: although this is fixable with a workaround via indirect assignment, there are a few other places in the code where PHP >= 5.4 is assumed.
I have now upgraded to PHP 5.4, it works now.
Great!
Jaap
P.S. If you keep using this email address to post to the list, could you register this email too? Then we don't have to manually approve your posts.