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

SQLGrammarException #662

Closed
sachgits opened this issue Aug 24, 2018 · 16 comments
Closed

SQLGrammarException #662

sachgits opened this issue Aug 24, 2018 · 16 comments
Labels

Comments

@sachgits
Copy link

SQLGrammarException

Steps to Reproduce

  1. build latest streama
  2. install mysql 57
  3. run streama using mysql datasource
  4. add movies via streama management space
  5. return to dashboard
  6. play movie

Expected Behaviour

movie should have started playing using streama video player

Actual Behaviour

internal server error

Environment Information

  • Operating System: openshift origin
  • Streama version: v1.6.0-RC6

Stack Trace

INFO streama.Application - Started Application in 67.293 seconds (JVM running for 74.881)
Grails application running at http://localhost:8080  in environment: production
ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - 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 '))) and this_.deleted=0) and this_.id<>1) and this_.id>1) limit 1' at line 1
ERROR StackTrace - Full Stack Trace:
org.grails.web.converters.exceptions.ConverterException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
	at org.grails.web.converters.marshaller.ClosureObjectMarshaller.marshalObject(ClosureObjectMarshaller.java:65)
	at grails.converters.JSON.value(JSON.java:184)
	at grails.converters.JSON.render(JSON.java:119)
	at grails.converters.JSON.render(JSON.java:132)
	at grails.artefact.controller.support.ResponseRenderer$Trait$Helper.render(ResponseRenderer.groovy:190)
	at grails.artefact.controller.support.ResponseRenderer$Trait$Helper$render$2.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
	at streama.VideoController.render(VideoController.groovy)
	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:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
	at streama.VideoController$_show_closure4.doCall(VideoController.groovy:100)
	at streama.VideoController$_show_closure4.doCall(VideoController.groovy)
	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:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at groovy.lang.Closure.call(Closure.java:414)
	at groovy.lang.Closure.call(Closure.java:408)
	at grails.converters.JSON.use(JSON.java:384)
	at grails.converters.JSON$use$2.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
	at streama.VideoController.show(VideoController.groovy:99)
	at streama.VideoController.$tt__show(VideoController.groovy)
	at streama.VideoController$_show_closure12.doCall(VideoController.groovy)
	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:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at groovy.lang.Closure.call(Closure.java:414)
	at groovy.lang.Closure.call(Closure.java:430)
	at grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:96)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)
	at streama.VideoController.show(VideoController.groovy)
	at org.grails.core.DefaultGrailsControllerClass$MethodHandleInvoker.invoke(DefaultGrailsControllerClass.java:222)
	at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:187)
	at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:105)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:158)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
	at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:2122)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1905)
	at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1881)
	at org.hibernate.loader.Loader.doQuery(Loader.java:925)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
	at org.hibernate.loader.Loader.doList(Loader.java:2622)
	at org.hibernate.loader.Loader.doList(Loader.java:2605)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2434)
	at org.hibernate.loader.Loader.list(Loader.java:2429)
	at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1787)
	at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
	at org.grails.orm.hibernate.query.AbstractHibernateQuery.singleResultViaListCall(AbstractHibernateQuery.java:785)
	at org.grails.orm.hibernate.query.AbstractHibernateQuery.singleResult(AbstractHibernateQuery.java:775)
	at grails.gorm.DetachedCriteria$_get_closure1.doCall(DetachedCriteria.groovy:115)
	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:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at grails.gorm.DetachedCriteria$_withPopulatedQuery_closure8.doCall(DetachedCriteria.groovy:764)
	at sun.reflect.GeneratedMethodAccessor428.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at groovy.lang.Closure.call(Closure.java:414)
	at groovy.lang.Closure.call(Closure.java:430)
	at org.grails.datastore.gorm.GormStaticApi$_withDatastoreSession_closure22.doCall(GormStaticApi.groovy:831)
	at sun.reflect.GeneratedMethodAccessor427.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at groovy.lang.Closure.call(Closure.java:414)
	at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54)
	at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:124)
	at com.sun.proxy.$Proxy109.doInSession(Unknown Source)
	at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:318)
	at org.grails.datastore.gorm.AbstractDatastoreApi.execute(AbstractDatastoreApi.groovy:40)
	at org.grails.datastore.gorm.GormStaticApi.withDatastoreSession(GormStaticApi.groovy:830)
	at org.grails.datastore.gorm.GormEntity$Trait$Helper.withDatastoreSession(GormEntity.groovy:899)
	at org.grails.datastore.gorm.GormEntity$Trait$Helper$withDatastoreSession$9.call(Unknown Source)
	at streama.Movie.withDatastoreSession(Movie.groovy)
	at streama.Movie$withDatastoreSession$3.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at streama.GenericVideo$withDatastoreSession$0.call(Unknown Source)
	at grails.gorm.DetachedCriteria.withPopulatedQuery(DetachedCriteria.groovy:735)
	at grails.gorm.DetachedCriteria.get(DetachedCriteria.groovy:114)
	at grails.gorm.DetachedCriteria.find(DetachedCriteria.groovy:85)
	at grails.gorm.DetachedCriteria.find(DetachedCriteria.groovy:84)
	at org.grails.datastore.gorm.GormStaticApi.find(GormStaticApi.groovy:233)
	at org.grails.datastore.gorm.GormEntity$Trait$Helper.find(GormEntity.groovy:468)
	at org.grails.datastore.gorm.GormEntity$Trait$Helper$find$14.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
	at streama.Movie.find(Movie.groovy)
	at streama.Movie$find$7.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at streama.Video.suggestNextVideo(Video.groovy:123)
	at streama.Video$suggestNextVideo$5.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
	at streama.marshallers.PlayerMarshallerService$__tt__init_closure2$_closure3.doCall(PlayerMarshallerService.groovy:66)
	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:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
	at groovy.lang.Closure.call(Closure.java:414)
	at groovy.lang.Closure.call(Closure.java:430)
	at org.grails.web.converters.marshaller.ClosureObjectMarshaller.marshalObject(ClosureObjectMarshaller.java:50)
	... 138 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '))) and this_.deleted=0) and this_.id<>1) and this_.id>1) limit 1' at line 1
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
	at com.mysql.jdbc.Util.getInstance(Util.java:383)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2002)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
	... 228 common frames omitted
@Jeronimo95
Copy link
Contributor

Did you create a database for Streama after installing MySQL?

@sachgits
Copy link
Author

@Jeronimo95 i instanciated database from openshift with with streama database the cli command
commandline oc new-app docker.io/openshift/mysql57-centos7 --enviroment database=strema, mysqluser=streama,mysql_password=streama
also streama works well while storing users and movies error shows up when playing

@EMcCormack
Copy link

@Jeronimo95 I don't think the server would start if the database wasn't instantiated

@Jeronimo95
Copy link
Contributor

Yes sorry. Did you add a TMDB API key? If not maybe it trying to access metadata that's not there. I'll test the steps to reproduce and see if I can recreate.

@Jeronimo95
Copy link
Contributor

I've tested and can't seem to reproduce the issue on ubuntu or arch. Maybe it's an issue specific to something in openshift?

@sachgits
Copy link
Author

well @Jeronimo95 openshift just runs docker images and thats all i did

@Arjenlodder
Copy link

I've got the same issue (exactly the same error). The MySQL query is as follows: select this_.id as id1_18_1_, this_.version as version2_18_1_, this_.api_id as api_id3_18_1_, this_.date_created as date_cre4_18_1_, this_.deleted as deleted5_18_1_, this_.imdb_id as imdb_id6_18_1_, this_.intro_end as intro_en7_18_1_, this_.intro_start as intro_st8_18_1_, this_.last_updated as last_upd9_18_1_, this_.original_language as origina10_18_1_, this_.outro_start as outro_s11_18_1_, this_.overview as overvie12_18_1_, this_.popularity as popular13_18_1_, this_.report_count as report_14_18_1_, this_.vote_average as vote_av15_18_1_, this_.vote_count as vote_co16_18_1_, this_.backdrop_path as backdro18_18_1_, this_.poster_image_id as poster_19_18_1_, this_.poster_path as poster_20_18_1_, this_.release_date as release21_18_1_, this_.title as title22_18_1_, this_.trailer_key as trailer23_18_1_, genre3_.movie_genre_id as movie_ge1_4_, genre_alia1_.id as genre_id2_4_, genre_alia1_.id as id1_3_0_, genre_alia1_.version as version2_3_0_, genre_alia1_.api_id as api_id3_3_0_, genre_alia1_.name as name4_3_0_ from video this_ inner join movie_genre genre3_ on this_.id=genre3_.movie_genre_id inner join genre genre_alia1_ on genre3_.genre_id=genre_alia1_.id where this_.class='streama.Movie' and ((((this_.id<>4 and (genre_alia1_.id in ())) and this_.deleted=0) and this_.id<>4) and this_.id>4) limit 1

The problem is genre_alia1_.id IN (). e.g.: an empty IN selection. It seems to me like some data is missing somewhere, but I don't which data is used to propagate the IN () selection.

@Arjenlodder
Copy link

Arjenlodder commented Dec 28, 2018

I solved this by adding dbCreate: update to my dataSource in the application.yml and restarting Streama.

@kerberjg
Copy link

@Arjenlodder I'm experiencing the same issue ( #718 ). Could you please attach your full application.yml and tell me which version of Streama are you using? Are you running inside Docker? Are you using an external MySQL DB?

@Arjenlodder
Copy link

This is my full application.yml:
`environments:

production:
    dataSource:
        #For mysql database
        dbCreate: update
        driverClassName:  'com.mysql.jdbc.Driver'
        url: jdbc:mysql://localhost/streama
        username: streama
        password: --HIDDEN--
    server:
        port: 8088`

I'm using version 1.6.0 Final, without docker. External MySQL indeed.

@uinput
Copy link

uinput commented Mar 10, 2019

@Jeronimo95 I'm experiencing the same problem, and I'm willing to provide further information in order to fix this. I'd propose to reopen this issue as it does not seem to be fixed.

I'm running streama in Alpine Linux using openjdk8. Everything works find, except for playing videos. I'm receiving the very same error message as described above. Additionally, I found out that no genre is added when adding the videos from a local directory. This is fixed after a restart of streama when setting dbCreate: update, but restarting should not be necessary for watching a movie.

How is the current procedure to adding the genre tags? And is there any code requiring the genre to be set?

More observations:

  • Using the internal database of streama works just fine.
  • Adding a genre manually to the database after adding the movie resolves the issue.

More information about my setup:

  • I'm using an external database: mysql Ver 15.1 Distrib 10.2.22-MariaDB
  • Streama runs inside docker with openjdk8 installed.

@dularion
Copy link
Member

This is indeed bothersome.. i cant reproduce it for my personal streama server but in general we need to fix the genre issue and make the genre checks more null-safe. I would be OK with reopening this

@dularion dularion reopened this Mar 11, 2019
@uinput
Copy link

uinput commented Mar 11, 2019

@dularion I can help you reproducing this issue I guess as I'm just using a personal docker image for deployment. I'll describe my setup in hope for someone to reproduce it (or if someone gets me a hint, I may be able to have a look at the code myself).

This is the Dockerfile.

FROM alpine:latest

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 8080

ARG SRC_VERSION=1.6.0-FINAL
ARG SRC_URL=https://github.com/streamaserver/streama/releases/download/v${SRC_VERSION}/streama-${SRC_VERSION}.war

VOLUME /video

RUN set -xe \
	&& addgroup -g 82 -S abc \
	&& adduser -u 82 -D -S -H -G abc abc

RUN set -xe \
	&& apk update \
	&& apk upgrade \
	&& apk add --no-cache --virtual=run-deps \
		supervisor openjdk8-jre-base \
	&& apk add --no-cache --virtual=install-deps \
		curl \
	&& apk del --progress --purge \
	&& rm -rf /var/cache/apk/*

COPY etc /etc

WORKDIR /app

RUN set -xe \
	&& curl -L -o streama.war ${SRC_URL}

COPY application.yml .

RUN set -xe \
	&& chown -R abc:abc .

COPY entrypoint.sh /entrypoint.sh
RUN chmod 540 /entrypoint.sh

The entrypoint.sh just contains the following.

find /video -type f -print0 | xargs -0 chmod 0664
find /video -type d -print0 | xargs -0 chmod 0755
chown -R abc:abc /video

exec supervisord -c /etc/supervisor/supervisor.conf -n

For the application.yml, it's pretty much as described in your docs.

environments:
    production:
        dataSource:
            dbCreate: update
            driverClassName: 'com.mysql.cj.jdbc.Driver'
            url: jdbc:mysql://undisclosed/streama
            username: undisclosed
            password: undisclosed
        server:
            port: 8080

streama:
    regex:
        movies: ^(?<Name>.*)[._ ]\(\d{4}\).*
        shows:
            - ^(?<Name>.+)[._ ]S(?<Season>\d{2})E(?<Episode>\d{2,3}).*
            - ^(?<Name>.+)[._ ](?<Season>\d{1,2})x(?<Episode>\d{2,3}).*

Lastly, the etc/supervisor/supervisor.conf is configured to start streama.

[supervisord]
directory=/
nodaemon=true
user=root
pidfile=/tmp/supervisord.pid
logfile=/tmp/supervisord.log
logfile_maxbytes=20MB
logfile_backups=8
loglevel=info

[program:streama]
user=abc
directory=/app
command=java -jar streama.war

MariaDB has a user streama created and is successfully connected to obviously, otherwise the service would not work as described. Also, that user is given all permissions for the specified database.

This should be reproducible with an empty database. Just add a file to the volume and add it in streama. Without restarting the container/streama, one should not be able to watch the video. Once restarted, the database is updated (not sure what that means in terms of Grails), and the genre is added to the database entry. I've confirmed that it is indeed the missing genre that's causing the issues when trying to play the movie.

@ntv1000
Copy link

ntv1000 commented Mar 13, 2019

That's really unfortunate, I'm having the same issue. Any way I can help?

@dularion
Copy link
Member

dularion commented May 4, 2019

Fixed in v1.6.6

@dularion
Copy link
Member

dularion commented May 4, 2019

@dularion dularion closed this as completed May 4, 2019
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

8 participants