cloudcoderdotorg / CloudCoder

A web-based programming exercise system.
GNU Affero General Public License v3.0
71 stars 60 forks source link

Problem when configuring cloudcoderApp-v0.1.4.jar and cloudcoderBuilder-v0.1.4.jar #94

Open casiez opened 7 years ago

casiez commented 7 years ago

The following command fails when I run ./bootstrap.pl:

java -jar cloudcoderBuilder-v0.1.4.jar configure --editJar=cloudcoderBuilder-v0.1.4.jar --replace=cloudcoder.properties=cloudcoder.properties --replace=keystore.jks=keystore.jks

Details:

########################################################################

Configuring cloudcoderApp-v0.1.4.jar and cloudcoderBuilder-v0.1.4.jar... <<< ########################################################################

Creating cloudcoder.properties... Creating a keystore for communication between webapp and builder... Configuring cloudcoderApp-v0.1.4.jar... Configuring cloudcoderBuilder-v0.1.4.jar... Exception in thread "main" java.util.zip.ZipException: invalid entry size (expected 94 but got 105 bytes) at java.util.zip.ZipOutputStream.closeEntry(java.base@9-internal/ZipOutputStream.java:262) at org.cloudcoder.daemon.JarRewriter.rewrite(JarRewriter.java:200) at org.cloudcoder.builder2.server.Builder2DaemonController.main(Builder2DaemonController.java:156) Command java failed

I tried downloading cloudcoderApp-v0.1.4.jar in different ways but my file always has the same md5 sum: ccf19e5cb627858dc0f54440c95502c9 (is it correct?)

I run ubuntu 16.04.1 and the following java version:

java -version openjdk version "9-internal" OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src) OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)

Running mysql-server 5.7.16-0ubuntu0.16.04.1

Note that I had to change --pass to --password in the script, as follows, to make it working with mysql 5.7

# ----------------------------------------------------------------------
# Configure MySQL
# ----------------------------------------------------------------------
section("Configuring MySQL...");
print "Creating cloudcoder user...\n";
Run("mysql", "--user=root", "--password=$ccMysqlRootPasswd",
    "--execute=create user 'cloudcoder'\@'localhost' identified by '$ccMysqlCCPasswd'");
print "Granting permissions on cloudcoderdb to cloudcoder...\n";
Run("mysql", "--user=root", "--password=$ccMysqlRootPasswd",
    "--execute=grant all on cloudcoderdb.* to 'cloudcoder'\@'localhost'");
sidstamm commented 6 years ago

I had the same problem with my version of MySQL. I fixed it by changing "--pass=" to "-p" in my fork of this repo: https://github.com/sidstamm/CloudCoder/commit/7d1b7f4a518652aa6abc97422ab9f8ce918990bd

Not sure what syntax the older versions of MySQL use, but -p seems like it would be less likely to break old versions than --password. And in hindsight, the password probably needs to be wrapped in single quotes on the command line.

@daveho - it looks like you authored this section, so I'm reaching out to you. If you prefer I can create a PR for this, but it's such a tiny little fix...