Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

help with Fatal Error in Gdn_Database.Query();

njumaranjumara New
edited April 2012 in Vanilla 2.0 - 2.8

Hi,

I just started receiving the below error two days ago. Everything has been working fine with the forum before this.

I received the GDN Permission error and I checked for the table in phpMyAdmin. It does not exist. I can't figure out why it would have worked before though?

I contacted my host and they told me to reinstall. I would rather not lose all of my forum entries. Does anyone know how to fix this?

Also, I may have screwed up because I installed Vanilla into my existing wordpress database.

Do i need to start over with a new database? If I do, can I export the table needed and keep the content of the forum? If so, which tables do I export?

Any help is awesome as I can't figure this out at all. Below is the error message:

Table 'databasename.GDN_Permission' doesn't exist
select *
from GDN_Permission Permission
limit 1
The error occurred on or near: /home/user/domains/website.com/public_html/forum/library/database/class.database.php
283:          $PDOStatement = $this->Connection()->query($Sql);
284:       }
285: 
286:       if ($PDOStatement === FALSE) {
287:          trigger_error(ErrorMessage($this->GetPDOErrorMessage($this->Connection()->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
288:       }
289:       
290:       // Did this query modify data in any way?
291:       if ($ReturnType == 'ID') {

Backtrace:
/home/user/domains/website.com/public_html/forum/library/database/class.database.phpPHP::Gdn_ErrorHandler();
[/home/user/domains/website.com/public_html/forum/library/database/class.database.php:287] PHP::trigger_error();
[/home/user/domains/website.com/public_html/forum/library/database/class.sqldriver.php:1650] Gdn_Database->Query();
[/home/user/domains/website.com/public_html/forum/library/database/class.sqldriver.php:676] Gdn_SQLDriver->Query();
[/home/user/domains/website.com/public_html/forum/applications/dashboard/models/class.permissionmodel.php:476] Gdn_SQLDriver->Get();
[/home/user/domains/website.com/public_html/forum/applications/dashboard/models/class.permissionmodel.php:188] PermissionModel->PermissionColumns();
[/home/user/domains/website.com/public_html/forum/applications/dashboard/models/class.usermodel.php:234] PermissionModel->CachePermissions();
[/home/user/domains/website.com/public_html/forum/library/core/class.session.php:318] UserModel->DefinePermissions();
[/home/user/domains/website.com/public_html/forum/library/core/class.auth.php:36] Gdn_Session->Start();
[/home/user/domains/website.com/public_html/forum/bootstrap.php:168] Gdn_Auth->StartAuthenticator();
[/home/user/domains/website.com/public_html/forum/index.php:41] PHP::require_once();
Variables in local scope:
[Sql] 'select *
from GDN_Permission Permission
limit 1'
[InputParameters] array (
)
[Options] array (
  'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] false

Answers

  • First of all, as soon as you backup your database, nothing will be lost, so I would do that first.

    Second thing is that it's looking for GDN_Permission, while I think all table names should be lowercase, so maybe there's something wrong with the source of any of the plugins.

    Third. I would install Vanilla (and maybe WordPress) on your local PC using Wampp or Xampp, so you can try things out before you go 'live'

    When you install Vanilla locally and you're certain that either GDN_Permission OR gdn_permission table does not exist, then you can take further steps.

    One of the steps is one I haven't tried yet : run an update script you always run when you go from version to a newer version of Vanilla.

    If you want to make backups there's the PHPMyAdmin way and you can also (I think) use the Porter plugin.

    http://vanillaforums.org/addon/porter-core

    There was an error rendering this rich post.

  • Thanks underdog, what's weird is that the site has been working for months!

    It's just recently that it freaked out. Could it be a plugin issue? I could delete some via ftp and see if that works but I'm not sure if there are core vanilla plugins that I need to keep?

    When I'm in phpMyadmin I don't see a folder for GDN_Permisson at all, there are ones for comments and another one, but no permission. Was it always not there? If so, how did the site work for months before this issue? Seems strange.

    This isn't a site where I updated Vanilla, it was a fresh install of the latest version, 2 something.

    Really not sure what to do...

  • I get exactly the same problem. It keeps occurring periodically, then I reload and it goes away.

    I did a fresh vanilla install, new database - still happens.

    I use version: 2.0.18.2 - will upgrade to 2.0.18.4 help any?

  • OK - My error is slightly different - keeps on coming though

    Any ideas?

    Can't create/write to file '/tmp/#sql_ccd_0.MYI' (Errcode: 28)
    show columns from GDN_User
    The error occurred on or near: /......./library/database/class.database.php
    283: $PDOStatement = $this->Connection()->query($Sql);
    284: }
    285:
    286: if ($PDOStatement === FALSE) {
    287: trigger_error(ErrorMessage($this->GetPDOErrorMessage($this->Connection()->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
    288: }
    289:
    290: // Did this query modify data in any way?
    291: if ($ReturnType == 'ID') {

  • x00x00 MVP
    edited April 2012
  • x00 - Thanks for that - I´ll check the file system

  • Ok, start with checking the filesystem. Then install a vanilla 2.0.18.4 locally.

    Back up the Permission table separately. Back up the structure and data in separate files. Those are your troubleshooting files if it happens again.

    Expect these things not to happen again, until you have filesystem troubles :-)

    There should be a gdn_permission table for sure :-)

    There was an error rendering this rich post.

  • I have no idea how to start fixing this issue... let me just see if this sounds right?

    1) Install Vanilla locally. (what does that mean?)
    2) Back up permission table (the old one or the one from the new install? I'm guessing new because I don't even have one in phpmyadmin
    3)Back up Structure (what is this and where do i find it?)
    4) Back up Data (what data and where do i find it?)

    Then, what do you mean these are my trouble shooting files if this happens again? Am I supposed to do a fresh install of Vanilla in the current url that I am using? Won't i lose all the forum data I have already?

    I really can't figure out why this worked for months and now all of a sudden I have no permission file in my database and no way to add one?

    Really not sure how to proceed to fix this issue.

    Thanks everyone for your help!!!

  • njumara said:
    I have no idea how to start fixing this issue... let me just see if this sounds right?

    1) Install Vanilla locally. (what does that mean?)

    https://www.google.com/search?hl=en&as_q=xampp+how+do+I+install+a+script+locally&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=

    2) Back up permission table (the old one or the one from the new install? I'm guessing new because I don't even have one in phpmyadmin

    Yes, back up the permission table from the new, local install

    3)Back up Structure (what is this and where do i find it?)

    https://www.google.com/search?num=100&hl=en&lr=&as_qdr=all&q=phpmyadmin+how+do+i+backup+my+structure&oq=phpmyadmin+how+do+i+backup+my+structure&aq=f&aqi=&aql=&gs_l=serp.3...65484l83099l0l83421l59l59l11l16l20l0l173l2404l31j1l32l0.frgbld.

    4) Back up Data (what data and where do i find it?)

    https://www.google.com/search?num=100&hl=en&lr=&as_qdr=all&q=phpmyadmin+how+do+i+backup+my+database&oq=phpmyadmin+how+do+i+backup+my+database&aq=f&aqi=g-v1&aql=&gs_l=serp.3..0i15.6817l7375l0l7746l4l4l0l3l3l0l79l79l1l1l0.frgbld.

    Then, what do you mean these are my trouble shooting files if this happens again? Am I supposed to do a fresh install of Vanilla in the current url that I am using? Won't i lose all the forum data I have already?

    Whenever something goes 'wrong' you can fall back onto the backups you just made.

    Let's say that you have a vanilla install on http://www.mysite.com/vanilla/ and it's not working, because the gdn_permission table can not be found in phpMyAdmin

    In that case you try to make a new local install on http://localhost/vanilla and you go into the phpMyAdmin for that install
    You find the gdn_permission table for that install and you backup the structure for that gdn_permission table.

    You go to the phpMyAdmin of your website http://www.mysite.com and you confirm that you are still missing the gdn_permission table.

    Now you have the file you just backed up from your local install and you can restore that into the phpMyAdmin of http://www.mysite.com

    (hope this makes sense)

    There was an error rendering this rich post.

  • Thanks for all of your help Underdog but I just don't get it.

    1) Why was the forum working for months and then suddenly not working again.

    2) I looked into following your instructions and did them. Then I installed a fresh version of Vanilla in a new database and I receive this error:

    Got error -1 from storage engine|Gdn_Database|Query|insert GDN_Role (Name, Sort, Deletable, CanSession, Description, RoleID) values (:Name, :Sort, :Deletable, :CanSession, :Description, :RoleID)

    3) I just want vanilla to work, I like the forum a lot but I can't get it to work?

    Any idea how to fix this? Is this the lowercase uppercase problem I've read about?

    Thanks,

  • Hi, i clicked continue again just praying that something would magically work and i now get this error message:

    Error on rename of './ningbone_vanilla/GDN_Permission' to './ningbone_vanilla/#sql2-3cff-61fd' (errno: -1)|Gdn_Database|Query|alter table GDN_Permission add Garden.Email.Manage tinyint not null default 0

    Any thoughts?

  • You didn't install on your local PC, did you? Instead you tried a new install on the same host?

    Read these google results, please :-)

    https://www.google.com/search?num=100&hl=en&lr=&as_qdr=all&q="Got+error+-1+from+storage+engine"&oq="Got+error+-1+from+storage+engine"&aq=f&aqi=&aql=&gs_l=serp.12...10351l11310l0l12317l2l2l0l0l0l0l60l119l2l2l0.frgbld.

    Question : How happy are you with your current host?

    There was an error rendering this rich post.

  • x00x00 MVP
    edited April 2012

    -

    grep is your friend.

Sign In or Register to comment.