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

RuntimeException on fresh installation #1138

Closed
iamamused opened this issue Mar 30, 2016 · 15 comments
Closed

RuntimeException on fresh installation #1138

iamamused opened this issue Mar 30, 2016 · 15 comments
Assignees

Comments

@iamamused
Copy link

Trying to install and get

This query failed: SELECT directus_tables.* FROM directus_tables

after configuration is complete. The config step has everything as "yes".

Here's the actual output

{
"code":0,
"class":"RuntimeException",
"message":"This query failed: SELECT directus_tables.* FROM directus_tables",
"file":"/Users/jsambells/Documents/Projects/test/directus/api/core/Directus/Db/TableGateway/AclAwareTableGateway.php",
"line":486,
"trace":[
{
"file":"/Users/jsambells/Documents/Projects/test/directus/api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php",
"line":208,
"function":"executeSelect",
"class":"Directus\Db\TableGateway\AclAwareTableGateway",
"type":"->",
"args":[
{

}
]
},
{
"file":"/Users/jsambells/Documents/Projects/test/directus/api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php",
"line":195,
"function":"selectWith",
"class":"Zend\Db\TableGateway\AbstractTableGateway",
"type":"->",
"args":[
{

}
]
},
{
"file":"/Users/jsambells/Documents/Projects/test/directus/api/core/Directus/Bootstrap.php",
"line":259,
"function":"select",
"class":"Zend\Db\TableGateway\AbstractTableGateway",
"type":"->",
"args":[

]
},
{
"file":"/Users/jsambells/Documents/Projects/test/directus/api/core/Directus/MemcacheProvider.php",
"line":113,
"function":"Directus{closure}",
"class":"Directus\Bootstrap",
"type":"::",
"args":[

]
},
{
"file":"/Users/jsambells/Documents/Projects/test/directus/api/core/Directus/Bootstrap.php",
"line":262,
"function":"getOrCache",
"class":"Directus\MemcacheProvider",
"type":"->",
"args":[
"directus_tables",
{

},
1800
]
},
{
"function":"acl",
"class":"Directus\Bootstrap",
"type":"::",
"args":[
null
]
},
{
"file":"/Users/jsambells/Documents/Projects/test/directus/api/core/Directus/Bootstrap.php",
"line":40,
"function":"call_user_func",
"args":[
"Directus\Bootstrap::acl",
null
]
},
{
"file":"/Users/jsambells/Documents/Projects/test/directus/api/api.php",
"line":125,
"function":"get",
"class":"Directus\Bootstrap",
"type":"::",
"args":[
"acl"
]
},
{
"file":"/Users/jsambells/Documents/Projects/test/directus/index.php",
"line":13,
"args":[
"/Users/jsambells/Documents/Projects/test/directus/api/api.php"
],
"function":"require"
}
],
"traceAsString":"#0 /Users/jsambells/Documents/Projects/test/directus/api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(208): Directus\Db\TableGateway\AclAwareTableGateway->executeSelect(Object(Zend\Db\Sql\Select))\n#1 /Users/jsambells/Documents/Projects/test/directus/api/vendor/zendframework/zend-db/src/TableGateway/AbstractTableGateway.php(195): Zend\Db\TableGateway\AbstractTableGateway->selectWith(Object(Zend\Db\Sql\Select))\n#2 /Users/jsambells/Documents/Projects/test/directus/api/core/Directus/Bootstrap.php(259): Zend\Db\TableGateway\AbstractTableGateway->select()\n#3 /Users/jsambells/Documents/Projects/test/directus/api/core/Directus/MemcacheProvider.php(113): Directus\Bootstrap::Directus{closure}()\n#4 /Users/jsambells/Documents/Projects/test/directus/api/core/Directus/Bootstrap.php(262): Directus\MemcacheProvider->getOrCache('directus_tables', Object(Closure), 1800)\n#5 [internal function]: Directus\Bootstrap::acl(NULL)\n#6 /Users/jsambells/Documents/Projects/test/directus/api/core/Directus/Bootstrap.php(40): call_user_func('Directus\Bootst...', NULL)\n#7 /Users/jsambells/Documents/Projects/test/directus/api/api.php(125): Directus\Bootstrap::get('acl')\n#8 /Users/jsambells/Documents/Projects/test/directus/index.php(13): require('/Users/jsambell...')\n#9 {main}"
}

@wellingguzman
Copy link

hey @iamamused how did you install directus? did you use the master, development or build branch? I tested on master, development and build branch. is there something else I should know to replicate the issues besides the log?

are the directus_ tables created on your MySQL database?

@iamamused
Copy link
Author

Ultimately it was a configuration in my mysql server. Directus didn't like the default sql_mode that was set. In api/api.php I added a set sql_mode query and then things started working correctly.

$ZendDb = Bootstrap::get('ZendDb');
$ZendDb->query('SET sql_mode="TRADITIONAL"')->execute();

@wellingguzman
Copy link

@iamamused perhaps this mode was STRICT_TRANS_TABLES? we have another issue with this mysql mode in here #395.

I want to know if we have issue with that or another mysql mode.

Thanks.

@transiient
Copy link

@iamamused What line did you add that code on? I'm experiencing the same issue ( #1143 ) on my installation.

@wellingguzman
Copy link

@mascardoso
Copy link

Hello,
Just downloaded your build to check it out.
To me it happens the same thing that happened to @iamamused 25 days ago.
I also tried his solution of adding SQL MODE to Traditional but no avail.

I am running:

OS El Capitan 10.11.3
PHP version: 5.6.10
MySQL version: 5.5.42
with all the requirements you need.

@benhaynes
Copy link
Sponsor Member

Looking into this a bit further...

@benhaynes benhaynes reopened this Apr 24, 2016
@wellingguzman
Copy link

hey @anotherwebstorm, could you tell us which tables did create and what MySQL modes do you have enabled?

@mascardoso
Copy link

Sure.
These are the created tables:

directus_bookmarks
directus_columns
directus_files
directus_groups
directus_schema_migrations

About MySQL modes

I don't exactly what you mean with this but if you could help me to know how to check them?

FYI I'm now only testing on a MAMP (latest version) Environment.

Thanks

@mascardoso
Copy link

I also forgot to mention that I have (probably this is what you would like also to know):

mcrypt support v2.5.8
PDO Driver for MySQL v5.0.11-dev - 20120503
GD Support bundled (2.1.0 compatible)

They are all enabled.

@wellingguzman
Copy link

@anotherwebstorm Thanks, I found the issue, it's an unsupported default CURRENT_TIMESTAMP default value in the migrations library.

I will let you know as soon as that's fixed.

@mascardoso
Copy link

That's awesome.
Thanks a lot.

@wellingguzman
Copy link

@anotherwebstorm I updated the build branch, can you confirm that it fixes the issue for you too?

@mascardoso
Copy link

Excelent Work.
Downloaded your master branch and it works.
Thanks.

@benhaynes
Copy link
Sponsor Member

Great! Thanks for reporting the issue @anotherwebstorm

Good job @wellingguzman!!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants