Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registerstudents: Unknown column 'courseId' #64

Closed
league opened this issue Sep 2, 2013 · 3 comments
Closed

registerstudents: Unknown column 'courseId' #64

league opened this issue Sep 2, 2013 · 3 comments
Labels

Comments

@league
Copy link

league commented Sep 2, 2013

Hey guys, I'm trying to load a tab-separated roster as described in the wiki, and I got a MySQLSyntaxErrorException. Here's the transcript:

$ java -jar cloudcoderApp-v0.0.7.1.jar registerstudents
For which course would you like to register students?
0 - CCDemo - CloudCoder demo course
1 - CS102 - Programming 1
[Enter value in range 0..1] 1
Enter the name of the file containing a tab-separated list student registration entries in this format: 
username        firstname       lastname        email   password        section
Usernames in the datbase will be re-used, but the names/email/password will not be updated,and users will not be registered for a course if they are already registered
[default: ] ==> /home/ubuntu/cloudcoder-accounts.csv
Note that this may be a slow operation
Some logging results will be appended to logs/cloudcoder.log rather than echoed to stdout
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'courseId' in 'where clause'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281)
        at org.cloudcoder.app.server.persist.ConfigurationUtil.getUsersInCourse(Unknown Source)
        at org.cloudcoder.app.server.persist.ConfigurationUtil.registerStudentsForCourseId2(Unknown Source)
        at org.cloudcoder.app.server.persist.RegisterStudents.registerStudents(Unknown Source)
        at org.cloudcoder.app.server.persist.RegisterStudents.main(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.cloudcoder.jetty.NestedJarClassLoader.runMain(Unknown Source)
        at org.cloudcoder.jetty.WebServer.runAdminCommand(Unknown Source)
        at org.cloudcoder.jetty.WebServer.handleCommand(Unknown Source)
        at org.cloudcoder.webserver.CloudCoderWebServer.main(CloudCoderWebServer.java:61)
Database error: Unknown column 'courseId' in 'where clause'

I checked out the schema in MySQL to see how the column was specified there, and it seems to be course_id:

mysql> describe cc_course_registrations;
+-------------------+---------+------+-----+---------+----------------+
| Field             | Type    | Null | Key | Default | Extra          |
+-------------------+---------+------+-----+---------+----------------+
| id                | int(11) | NO   | PRI | NULL    | auto_increment |
| course_id         | int(11) | NO   |     | NULL    |                |
| user_id           | int(11) | NO   |     | NULL    |                |
| registration_type | int(11) | NO   |     | NULL    |                |
| section           | int(11) | NO   |     | NULL    |                |
+-------------------+---------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

I'm probably going to set up a dev environment shortly, so I can occasionally push patches into my live environment. Thanks for the help!

@league
Copy link
Author

league commented Sep 3, 2013

I was able to work around this using the "Bulk Register" button on the Users page, so maybe it can be considered as a documentation bug.

@daveho
Copy link

daveho commented Sep 6, 2013

I pushed a fix to my public repository. We will test this before the next
release. Thanks for the report!

daveho added a commit that referenced this issue Sep 8, 2013
@daveho
Copy link

daveho commented Jun 26, 2014

I'm going to optimistically assume that this is fixed :-)

@daveho daveho closed this as completed Jun 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants