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

[repository][jdbc] Error when using mysql 8.0.11 (new keywords) #1498

Closed
simpleusr opened this Issue Sep 13, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@simpleusr

simpleusr commented Sep 13, 2018

Expected Behavior

All db tables should be created

Current Behavior

roles table can not be created

Possible Solution

Steps to Reproduce (for bugs)

  1. Add gravitee-repository-jdbc-1.18.0.zip to plugins and mysql-connector-java-8.0.11.jar to /lib/ext
  2. Try to Start gateway component

Context

Gateway and management components does not start properly

Your Environment

  • Version used: 1.18.0
  • Browser Name and version:
  • Operating System and version:

We have the below error:

09:18:33.043 [gravitee] [] ERROR i.g.r.j.c.AbstractJdbcRepositoryConfiguration - Failed to set up database:
liquibase.exception.MigrationFailedException: Migration failed for change set liquibase/changelogs/v1_14_0/schema.yml::1.14.0::GraviteeSource Team:
Reason: liquibase.exception.DatabaseException: 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 'system BIT(1) NOT NULL, created_at timestamp(6) NULL, updated_at timestamp(6) NU' at line 1 [Failed SQL: CREATE TABLE gravitee.roles (scope NVARCHAR(64) NOT NULL, name NVARCHAR(128) NOT NULL, description NVARCHAR(1024) NULL, default_role BIT(1) NOT NULL, system BIT(1) NOT NULL, created_at timestamp(6) NULL, updated_at timestamp(6) NULL)]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
at liquibase.Liquibase.update(Liquibase.java:214)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:188)
at io.gravitee.repository.jdbc.common.AbstractJdbcRepositoryConfiguration.runLiquibase(AbstractJdbcRepositoryConfiguration.java:130)
at io.gravitee.repository.jdbc.common.AbstractJdbcRepositoryConfiguration.graviteeDataSource(AbstractJdbcRepositoryConfiguration.java:104)
at io.gravitee.repository.jdbc.common.AbstractJdbcRepositoryConfiguration.setApplicationContext(AbstractJdbcRepositoryConfiguration.java:78)
at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:121)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:97)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1575)

Mysql version is 8.0.11
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-S
It looks like system is added as a reserved keyword......

@aelamrani aelamrani changed the title from Error in gateway when using mysql/jdbc repository to [repository][jdbc] Error when using mysql 8.0.11 (new keywords) Sep 13, 2018

@aelamrani aelamrani self-assigned this Sep 13, 2018

@aelamrani aelamrani added the type: bug label Sep 13, 2018

@aelamrani aelamrani added this to the 1.20.0 milestone Sep 13, 2018

aelamrani added a commit to gravitee-io/gravitee-repository-jdbc that referenced this issue Sep 13, 2018

aelamrani added a commit to gravitee-io/gravitee-repository-jdbc that referenced this issue Sep 13, 2018

aelamrani added a commit to gravitee-io/gravitee-repository-jdbc that referenced this issue Sep 13, 2018

@aelamrani

This comment has been minimized.

@simpleusr

This comment has been minimized.

simpleusr commented Sep 13, 2018

Hi @aelamrani ,

I think my fault to mention that my gravitee version is 1.18.1.

Your plugin gave the following error:

13:06:49.561 [gravitee] [] ERROR i.g.p.c.i.PluginContextFactoryImpl - Unable to refresh plugin context
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [io.gravitee.repository.jdbc.management.JdbcManagementRepositoryConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [io/gravitee/repository/management/api/DictionaryRepository.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:187)

But as I understand this is due to new feature additions..

I locally applied your fix to gravitee-repository-jdbc-1.18.0 and error disappeared:)

I think I am ok now.

Just having the below exception in debug mode and this seems totally unrelated right??

If so you can close the issue.

Regards

13:21:47.302 [gateway-monitor] [] DEBUG i.g.g.s.m.probe.ProcessProbe - Unexpected exception
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at io.gravitee.gateway.services.monitoring.probe.ProcessProbe.getOpenFileDescriptorCount(ProcessProbe.java:78)
at io.gravitee.gateway.services.monitoring.probe.ProcessProbe.processInfo(ProcessProbe.java:89)
at io.gravitee.gateway.services.monitoring.MonitorThread.run(MonitorThread.java:74)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

gravitee_success_patch_applied_1_18_0.log
gravitee_fail.log

@aelamrani aelamrani removed this from the 1.20.0 milestone Sep 13, 2018

@aelamrani

This comment has been minimized.

Member

aelamrani commented Sep 13, 2018

Ok, i keep this issue opened as we will close it when the fix will be merged (gravitee-io/gravitee-repository-jdbc#23)

aelamrani added a commit to gravitee-io/gravitee-repository-jdbc that referenced this issue Sep 13, 2018

aelamrani added a commit to gravitee-io/gravitee-repository-jdbc that referenced this issue Sep 13, 2018

NicolasGeraud added a commit to gravitee-io/gravitee-repository-jdbc that referenced this issue Sep 13, 2018

@NicolasGeraud NicolasGeraud added this to the 1.19.1 milestone Sep 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment