Import issues when using MySQL back-end
Reported by Steven Wagner | July 12th, 2011 @ 02:41 PM | in Rundeck 1.4 (closed)
After a bit of trial-and-error, I thought I had the 1.2.1 version of the app working with a MySQL back-end using the following config:
dataSource.pooled = true
dataSource.dialect = org.hibernate.dialect.MySQLDialect
dataSource.driverClassName = com.mysql.jdbc.Driver
dataSource.username = rundeck
dataSource.password = awesomerundeckpassword
dataSource.url = jdbc:mysql://primaryserver,slaveserver:3306/rundeck?autoCommit=true&autoReconnect=true
On startup, I saw this error, which seems related to ticket #258 ("option" is a reserved word in MySQL land):
ERROR SchemaUpdate: Unsuccessful: create table option (id bigint not null auto_increment, version bigint not null, values_url tinyblob, scheduled_execution_id bigint, regex varchar(255), delimiter varchar(255), description varchar(255), name varchar(255) not null, enforced bit not null, default_value varchar(255), required bit, multivalued bit, primary key (id))
ERROR SchemaUpdate: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option (id bigint not null auto_increment, version bigint not null, values_url t' at line 1
ERROR SchemaUpdate: Unsuccessful: alter table option add index FKC3CA8875243CF2FF (scheduled_execution_id), add constraint FKC3CA8875243CF2FF foreign key (scheduled_execution_id) references scheduled_execution (id)
ERROR SchemaUpdate: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option add index FKC3CA8875243CF2FF (scheduled_execution_id), add constraint FKC' at line 1
ERROR SchemaUpdate: Unsuccessful: alter table option_values add index FKCF0B942CFB2E8DBA (option_id), add constraint FKCF0B942CFB2E8DBA foreign key (option_id) references option (id)
ERROR SchemaUpdate: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option (id)' at line 1
I temporarily sidestepped this issue by creating the table as rundeck.option, which got MySQL to do the right thing. I modified the other ALTER TABLE commands to use the same syntax.
Now Rundeck starts without incident. I try to load an XML dump of all my jobs into the now-empty database with rd-jobs, but I get the following error:
$ rd-jobs load -f everything.xml
ERROR WebserviceHttpClientChannel: Unable to parse result document: Error on line 1 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
org.dom4j.DocumentException: Error on line 1 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at com.dtolabs.client.utils.WebserviceHttpClientChannel.postMakeRequest(WebserviceHttpClientChannel.java:238)
at com.dtolabs.client.utils.HttpClientChannel.makeRequest(HttpClientChannel.java:377)
at com.dtolabs.client.services.ServerService.makeRundeckRequest(ServerService.java:115)
at com.dtolabs.client.services.RundeckCentralDispatcher.loadJobs(RundeckCentralDispatcher.java:808)
at com.dtolabs.rundeck.core.cli.jobs.JobsTool.loadAction(JobsTool.java:616)
at com.dtolabs.rundeck.core.cli.jobs.JobsTool.go(JobsTool.java:589)
at com.dtolabs.rundeck.core.cli.BaseTool.run(BaseTool.java:107)
at com.dtolabs.rundeck.core.cli.jobs.JobsTool.main(JobsTool.java:368)
Nested exception:
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at com.dtolabs.client.utils.WebserviceHttpClientChannel.postMakeRequest(WebserviceHttpClientChannel.java:238)
at com.dtolabs.client.utils.HttpClientChannel.makeRequest(HttpClientChannel.java:377)
at com.dtolabs.client.services.ServerService.makeRundeckRequest(ServerService.java:115)
at com.dtolabs.client.services.RundeckCentralDispatcher.loadJobs(RundeckCentralDispatcher.java:808)
at com.dtolabs.rundeck.core.cli.jobs.JobsTool.loadAction(JobsTool.java:616)
at com.dtolabs.rundeck.core.cli.jobs.JobsTool.go(JobsTool.java:589)
at com.dtolabs.rundeck.core.cli.BaseTool.run(BaseTool.java:107)
at com.dtolabs.rundeck.core.cli.jobs.JobsTool.main(JobsTool.java:368)
Error: Failed request to load jobs: Response content unexpectedly empty. Jobs Uploaded. Succeeded: 0, Failed: 5, Skipped: 0
The same document imports into the app if I flip the storage back end back to HyperSQL.
Also, the "who's online" example job XML from the documentation imports successfully.
Digging into service.log, I see this:
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'adhoc_local_string' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2932)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1566)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1480)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1465)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 261 more
This seems to indicate that queries aren't being constructed properly for MySQL to handle them... specifically, that a column isn't big enough to handle the data being inserted into it (maybe something's using a VARCHAR instead of a TEXT ?).
Anyway, I hope this report at least gives you a starting point to find a solution. If you need any further information, please let me know.
Comments and changes to this ticket
-
Jeffrey Hulten August 30th, 2011 @ 08:05 PM
"option" is a MySQL reserved work and so needs to be quoted to ensure that it does not error out.
-
Moses Lei September 6th, 2011 @ 12:33 AM
- Tag set to bug, database
- Assigned user set to Greg Schueler
Assigning to gschueler since he did some work on getting MySQL to work
-
Greg Schueler September 9th, 2011 @ 04:23 PM
- State changed from new to open
- Milestone set to Rundeck 1.4
- Milestone order changed from 73 to 0
-
Greg Schueler September 9th, 2011 @ 04:57 PM
(from [5e513627bc9fd5ee6a7523b1a06fbb3d22cb01de]) Support mysql/oracle by using non-reserved words
Set table/field names to non-reserved words for some domain
classes if the rundeck.v14.rdbsupport config value is "true"set the value to true by default
[#383] https://github.com/dtolabs/rundeck/commit/5e513627bc9fd5ee6a7523b1a...
-
Greg Schueler September 12th, 2011 @ 06:51 PM
(from [0cde5d3a2e39a8d6f46fa9e708fecabf6a9306cd]) Update db column types to be 'text' for mysql support [#383] https://github.com/dtolabs/rundeck/commit/0cde5d3a2e39a8d6f46fa9e70...
-
Greg Schueler September 12th, 2011 @ 06:51 PM
(from [6d451b79a37a55b1704316c6d8a50511dca84dad]) Update api test to sleep 1 for dbs where time resolution is more granular [#383] https://github.com/dtolabs/rundeck/commit/6d451b79a37a55b1704316c6d...
-
Greg Schueler September 22nd, 2011 @ 01:02 PM
(from [bbea633245af820c2a248270e6281409d38c332b]) Fix oracle test failures [#383]
Resolve oracle test error with 'possible nonthreadsafe access to
session' by flushing sessionFix NPE exceptions in tests by flushing save
merge from 1.3.1
https://github.com/dtolabs/rundeck/commit/bbea633245af820c2a248270e... -
Greg Schueler September 22nd, 2011 @ 01:02 PM
(from [35dd90c646f8e1b0a59d5e8aa6b3916a405e9ed4]) Fix some api test issues with oracle [#383]
merge from maint-1.3.1
https://github.com/dtolabs/rundeck/commit/35dd90c646f8e1b0a59d5e8aa... -
Greg Schueler September 22nd, 2011 @ 01:03 PM
(from [386a7e75bc3debb562988682d705af49e4c637ef]) Fix lock issue on oracle when aborting a job [#383]
merge from maint-1.3.1
https://github.com/dtolabs/rundeck/commit/386a7e75bc3debb562988682d... -
Greg Schueler September 22nd, 2011 @ 01:03 PM
(from [cff193776d7f0b7aff09f92bd2b32bfb6e21c003]) Change ScheduledExecution.description constraints
[#383]
merge from maint-1.3.1
https://github.com/dtolabs/rundeck/commit/cff193776d7f0b7aff09f92bd... -
Greg Schueler October 11th, 2011 @ 02:54 PM
- State changed from open to needs_verification
-
Greg Schueler October 12th, 2011 @ 03:24 PM
(from [765ebaf153fba7c18924c6e396696e3a2c4ffffd]) Update basereport title column for rdbsupport [#383] https://github.com/dtolabs/rundeck/commit/765ebaf153fba7c18924c6e39...
-
Greg Schueler October 25th, 2011 @ 12:06 PM
(from [d605d368ff771c1c289f362e29d5fe5fec2ce883]) Add nodeIncludeName as text for rdb [#383] https://github.com/dtolabs/rundeck/commit/d605d368ff771c1c289f362e2...
-
Greg Schueler October 25th, 2011 @ 03:42 PM
- State changed from needs_verification to resolved
-
Greg Schueler October 27th, 2011 @ 03:52 PM
(from [60f1a81b7092d2ab27ea3c38069a960435dbe29e]) Fix upgrade issue with description null values
[#383] https://github.com/dtolabs/rundeck/commit/60f1a81b7092d2ab27ea3c380...
-
Greg Schueler October 27th, 2011 @ 03:52 PM
(from [e13740e28b37f2014b7f47544b969cf1a7b55a4b]) Fix job description null in views [#383] https://github.com/dtolabs/rundeck/commit/e13740e28b37f2014b7f47544...
-
Greg Schueler October 27th, 2011 @ 03:52 PM
(from [39f94a77ac516655a72fb6d5a92d031c9726813f]) Change default configuration to rdbsupport=false
[#383] https://github.com/dtolabs/rundeck/commit/39f94a77ac516655a72fb6d5a...
-
Williams Daniel May 5th, 2023 @ 09:02 PM
One of the problems I often encounter is Database Connection Error: This is the most common problem when using MySQL back-end. To fix this, you should check the connec,tion information to MySQL such as hostname, username and password. If you are sure that the credentials are correct, slither io check that the MySQL server is enabled.
-
William Newman July 16th, 2023 @ 10:52 AM
Versatile Application improvement is an intricate cycle. That is the reason if you have any desire to employ an independent portable application designer, you ought to burn through heaps of effort and assets. In any case, organizations like Mobilunity have an extraordinary organization of confirmed and qualified designers that are prepared to help whenever. They will assist you with setting aside cash and valuable time>> https://mobilunity.com/blog/how-to-hire-freelance-mobile-app-developer-in-2023/
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues
People watching this ticket
Referenced by
- 383 Import issues when using MySQL back-end (from [bbea633245af820c2a248270e6281409d38c332b]) Fix ora...
- 383 Import issues when using MySQL back-end (from [35dd90c646f8e1b0a59d5e8aa6b3916a405e9ed4]) Fix som...
- 383 Import issues when using MySQL back-end (from [386a7e75bc3debb562988682d705af49e4c637ef]) Fix loc...
- 383 Import issues when using MySQL back-end [#383]