Closed Tropicalista closed 4 years ago
Can you point me at an example repo I can clone and run?
Here's my repo: https://github.com/Tropicalista/wpscanner
I think the problem is with autodiscover grammar.
Changing autodiscover to mysql grammar in box.json solved my issue.
I suppose the problem is with this code:
property name="defaultGrammar" default="AutoDiscover";
Shouldn't it be?
property name="defaultGrammar" default="AutoDiscover@qb";
The AutoDiscover
mapping changed in qb@7
. If that is the issue, that's a pretty poor error message. :-/
I'm getting this exact same error but with "defaultGrammar": "SqlServerGrammar@qb", so there may be something more going on... https://www.screencast.com/t/wnlUAVihE0n & https://www.screencast.com/t/vjoSNtxAz5
@Daemach I suppose you're on windows too. Is that correct?
That is correct.
Can you try to set up like this:
"cfmigrations":{
"schema":"${DB_SCHEMA}",
"connectionInfo":{
"password":"${DB_PASSWORD}",
"connectionString":"${DB_CONNECTIONSTRING}",
"class":"${DB_CLASS}",
"username":"${DB_USER}"
},
"defaultGrammar":"AutoDiscover@qb"
}
I get the same error with AutoDiscover@qb, unfortunately.
On Mon, Apr 6, 2020 at 8:49 PM Tropicalista notifications@github.com wrote:
Can you try to set up like this:
"cfmigrations":{ "schema":"${DB_SCHEMA}", "connectionInfo":{ "password":"${DB_PASSWORD}", "connectionString":"${DB_CONNECTIONSTRING}", "class":"${DB_CLASS}", "username":"${DB_USER}" }, "defaultGrammar":"AutoDiscover@qb" }
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/commandbox-modules/commandbox-migrations/issues/14#issuecomment-610157755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7Y5YKDPJRBWB3MDIKCRTLRLKPFXANCNFSM4LWLE5AQ .
Apparently this is a known bug for windows users. I'll just have to wait for it to be fixed.
On Tue, Apr 7, 2020 at 5:56 AM Daemach daemach@gmail.com wrote:
I get the same error with AutoDiscover@qb, unfortunately.
On Mon, Apr 6, 2020 at 8:49 PM Tropicalista notifications@github.com wrote:
Can you try to set up like this:
"cfmigrations":{ "schema":"${DB_SCHEMA}", "connectionInfo":{ "password":"${DB_PASSWORD}", "connectionString":"${DB_CONNECTIONSTRING}", "class":"${DB_CLASS}", "username":"${DB_USER}" }, "defaultGrammar":"AutoDiscover@qb" }
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/commandbox-modules/commandbox-migrations/issues/14#issuecomment-610157755, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7Y5YKDPJRBWB3MDIKCRTLRLKPFXANCNFSM4LWLE5AQ .
When running in to this issue are you running your migration on a different drive than you start CommandBox on?
I don't think so. But now that you mention it, I probably start commandbox from a symlink'd folder. Junction, though, so hard link.
On Wed, Apr 8, 2020 at 3:35 PM Eric Peterson notifications@github.com wrote:
When running in to this issue are you running your migration on a different drive than you start CommandBox on?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/commandbox-modules/commandbox-migrations/issues/14#issuecomment-611229242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7Y5YLCHWXJB6WQIUWLPUTRLT32BANCNFSM4LWLE5AQ .
I have tried to install my app on linux:
ERROR (5.0.1+00137) lucee.commons.lang.ClassException: cannot load class through its string name, because no definition for the class with the specified name [] could be found
/root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/modules/qb/models/Grammars/BaseGrammar.cfc: line 97
95: structAppend( data.options, { result: "local.result" }, true );
96: variables.log.debug( "Executing sql: #data.sql#", "With bindings: #serializeJSON( data.bindings )#" );
97: var q = queryExecute( data.sql, data.bindings, data.options );
98: data.query = isNull( q ) ? javacast( "null", "" ) : q;
99: data.result = local.result;
called from /root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/modules/qb/models/Schema/SchemaBuilder.cfc: line 291
called from /root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/models/MigrationService.cfc: line 193
called from /root/.CommandBox/cfml/modules/commandbox-migrations/models/BaseMigrationCommand.cfc: line 22
called from /root/.CommandBox/cfml/modules/commandbox-migrations/commands/migrate/up.cfc: line 30
called from /root/.CommandBox/cfml/system/services/CommandService.cfc: line 343
called from /root/.CommandBox/cfml/system/services/CommandService.cfc: line 158
called from /root/.CommandBox/cfml/system/Shell.cfc: line 768
called from /root/.CommandBox/cfml/system/Bootstrap.cfm: line 119
lucee.runtime.exp.NativeException: lucee.commons.lang.ClassException: cannot load class through its string name, because no definition for the class with the specified name [] could be found
at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:105)
at lucee.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:135)
at lucee.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:102)
at lucee.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:73)
at lucee.runtime.tag.Query.executeDatasoure(Query.java:1043)
at lucee.runtime.tag.Query._doEndTag(Query.java:660)
at lucee.runtime.tag.Query.doEndTag(Query.java:542)
at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:86)
at models.grammars.basegrammar_cfc$cf.udfCall1(/qb/models/Grammars/BaseGrammar.cfc:97)
That's a different error. Looks like your datasource settings didn't pick up from environment variables. You can run any of these commands with --verbose to see what commandbox-migrations is using.
On Apr 12 2020, at 4:38 pm, Tropicalista notifications@github.com wrote:
I have tried to install my app on linux:
ERROR (5.0.1+00137) lucee.commons.lang.ClassException: cannot load class through its string name, because no definition for the class with the specified name [] could be found
/root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/modules/qb/models/Grammars/BaseGrammar.cfc: line 97 95: structAppend( data.options, { result: "local.result" }, true ); 96: variables.log.debug( "Executing sql: #data.sql#", "With bindings: #serializeJSON( data.bindings )#" ); 97: var q = queryExecute( data.sql, data.bindings, data.options ); 98: data.query = isNull( q ) ? javacast( "null", "" ) : q; 99: data.result = local.result; called from /root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/modules/qb/models/Schema/SchemaBuilder.cfc: line 291 called from /root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/models/MigrationService.cfc: line 193 called from /root/.CommandBox/cfml/modules/commandbox-migrations/models/BaseMigrationCommand.cfc: line 22 called from /root/.CommandBox/cfml/modules/commandbox-migrations/commands/migrate/up.cfc: line 30 called from /root/.CommandBox/cfml/system/services/CommandService.cfc: line 343 called from /root/.CommandBox/cfml/system/services/CommandService.cfc: line 158 called from /root/.CommandBox/cfml/system/Shell.cfc: line 768 called from /root/.CommandBox/cfml/system/Bootstrap.cfm: line 119
lucee.runtime.exp.NativeException: lucee.commons.lang.ClassException: cannot load class through its string name, because no definition for the class with the specified name [] could be found at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:105) at lucee.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:135) at lucee.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:102) at lucee.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:73) at lucee.runtime.tag.Query.executeDatasoure(Query.java:1043) at lucee.runtime.tag.Query._doEndTag(Query.java:660) at lucee.runtime.tag.Query.doEndTag(Query.java:542) at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:86) at models.grammars.basegrammar_cfc$cf.udfCall1(/qb/models/Grammars/BaseGrammar.cfc:97) — You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/commandbox-modules/commandbox-migrations/issues/14#issuecomment-612686855), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AATWYXXRCLBHHK6RLTTO4VTRMI7GXANCNFSM4LWLE5AQ).
This is the full error with verbose true:
cfmigrations info:
{"schema":"wpscan","connectionInfo":{"password":"Mys3Cr3tP4ssw0rd","connectionString":"jdbc:mysql://localhost:3306/wpscan?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Etc/UTC&useLegacyDatetimeCode=true","class":"com.mysql.cj.jdbc.Driver","username":"root"},"defaultGrammar":"MySQLGrammar@qb"}
ERROR (5.0.1+00137) java.lang.NullPointerException
/root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/modules/qb/models/Grammars/BaseGrammar.cfc: line 97
95: structAppend( data.options, { result: "local.result" }, true );
96: variables.log.debug( "Executing sql: #data.sql#", "With bindings: #serializeJSON( data.bindings )#" );
97: var q = queryExecute( data.sql, data.bindings, data.options );
98: data.query = isNull( q ) ? javacast( "null", "" ) : q;
99: data.result = local.result;
called from /root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/modules/qb/models/Schema/SchemaBuilder.cfc: line 291
called from /root/.CommandBox/cfml/modules/commandbox-migrations/modules/cfmigrations/models/MigrationService.cfc: line 193
called from /root/.CommandBox/cfml/modules/commandbox-migrations/models/BaseMigrationCommand.cfc: line 22
called from /root/.CommandBox/cfml/modules/commandbox-migrations/commands/migrate/up.cfc: line 30
called from /root/.CommandBox/cfml/system/services/CommandService.cfc: line 343
called from /root/.CommandBox/cfml/system/services/CommandService.cfc: line 158
called from /root/.CommandBox/cfml/system/Shell.cfc: line 768
called from /root/.CommandBox/cfml/system/Bootstrap.cfm: line 119
lucee.runtime.exp.NativeException: java.lang.NullPointerException
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at java.net.AbstractPlainSocketImpl$1.run(AbstractPlainSocketImpl.java:84)
at java.net.AbstractPlainSocketImpl$1.run(AbstractPlainSocketImpl.java:82)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.AbstractPlainSocketImpl.<clinit>(AbstractPlainSocketImpl.java:81)
at java.net.Socket.setImpl(Socket.java:521)
at java.net.Socket.<init>(Socket.java:86)
at com.mysql.cj.protocol.StandardSocketFactory.createSocket(StandardSocketFactory.java:77)
at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:145)
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65)
at com.mysql.cj.NativeSession.connect(NativeSession.java:152)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at lucee.runtime.db.DataSourceSupport._getConnection(DataSourceSupport.java:113)
at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:95)
at lucee.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:135)
at lucee.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:102)
at lucee.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:73)
at lucee.runtime.tag.Query.executeDatasoure(Query.java:1043)
at lucee.runtime.tag.Query._doEndTag(Query.java:660)
at lucee.runtime.tag.Query.doEndTag(Query.java:542)
at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:86)
at models.grammars.basegrammar_cfc$cf.udfCall1(/qb/models/Grammars/BaseGrammar.cfc:97)
at models.grammars.basegrammar_cfc$cf.udfCall(/qb/models/Grammars/BaseGrammar.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1709)
at models.schema.schemabuilder_cfc$cf.udfCall2(/qb/models/Schema/SchemaBuilder.cfc:291)
at models.schema.schemabuilder_cfc$cf.udfCall(/qb/models/Schema/SchemaBuilder.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1709)
at modules.commandbox_migrations495.modules.cfmigrations.models.migrationservice_cfc$cf$4.udfCall3(/commandbox/modules/commandbox-migrations/modules/cfmigrations/models/MigrationService.cfc:193)
at modules.commandbox_migrations495.modules.cfmigrations.models.migrationservice_cfc$cf$4.udfCall(/commandbox/modules/commandbox-migrations/modules/cfmigrations/models/MigrationService.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1709)
at models.basemigrationcommand_cfc$cf$3.udfCall(/commandbox-migrations/models/BaseMigrationCommand.cfc:22)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:779)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1709)
at modules.commandbox_migrations495.commands.migrate.up_cfc$cf.udfCall(/commandbox/modules/commandbox-migrations/commands/migrate/up.cfc:30)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:205)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1728)
at system.services.commandservice_cfc$cf.udfCall1(/commandbox/system/services/CommandService.cfc:343)
at system.services.commandservice_cfc$cf.udfCall(/commandbox/system/services/CommandService.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:205)
at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:792)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1728)
at system.services.commandservice_cfc$cf.udfCall1(/commandbox/system/services/CommandService.cfc:158)
at system.services.commandservice_cfc$cf.udfCall(/commandbox/system/services/CommandService.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:205)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1728)
at system.shell_cfc$cf.udfCall4(/commandbox/system/Shell.cfc:768)
at system.shell_cfc$cf.udfCall(/commandbox/system/Shell.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:205)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:681)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1728)
at _commandbox46.cfml.system.bootstrap_cfm$cf.call(/__commandbox_root/.CommandBox/cfml/system/Bootstrap.cfm:119)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:944)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:836)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:818)
at 1hakaskpj4qmq.call(Unknown Source)
at lucee.runtime.compiler.Renderer.tag(Renderer.java:108)
at lucee.runtime.compiler.Renderer.script(Renderer.java:98)
at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:62)
at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:193)
at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:328)
at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:153)
at cliloader.LoaderCLIMain.main(LoaderCLIMain.java:552)
Caused by: java.lang.NullPointerException
... 113
I want also add that I'm able to create migrations table, but not the others migrations.
The long national nightmare is over. Update to cfmigrations@2.0.4
to fix Windows + CommandBox 5 migrations issues.
(Hint: run update --system
and it should take of it for you.)
I'm trying to run a migration, but I always got this error.
The requested migration file is there.
What can be the problem?
I'm on windows.