Topic: SQL ERROR

I received an email stating there was an error in a cronjob.  The file listed is webcal/lcalcron.php. I am instructed to look at /logs/sql.log.  There I find:

**start of log entry

2019.09.06 05:03:47 mycal:ERROR Script:  - SQL query error: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Query string: SELECT
        e.`ID` AS eid,
        e.`private` AS pri,
        e.`title` AS tit,
        e.`venue` AS ven,
        e.`text1` AS des,
        e.`text2` AS xf1,
        e.`text3` AS xf2,
        e.`attach` AS att,
        e.`catID` AS cid,
        e.`scatID` AS sid,
        e.`userID` AS uid,
        e.`editor` AS edr,
        e.`approved` AS apd,
        e.`notEml` AS nom,
        e.`notSms` AS nos,
        e.`sDate` AS sda,
        e.`eDate` AS eda,
        e.`sTime` AS sti,
        e.`eTime` AS eti,
        e.`rType` AS r_t,
        e.`rInterval` AS r_i,
        e.`rPeriod` AS r_p,
        e.`rMonth` AS r_m,
        e.`rUntil` AS r_u,
        e.`aDateTime` AS adt,
        e.`mDateTime` AS mdt,
        e.`status` AS sts,
        c.`name` AS cnm,
        c.`sequence` AS seq,
        c.`approve` AS app,
        c.`dayColor` AS dbg,
        c.`color` AS cco,
        c.`bgColor` AS cbg,
        c.`subName1` AS sn1,
        c.`subColor1` AS sc1,
        c.`subBgrnd1` AS sb1,
        c.`subName2` AS sn2,
        c.`subColor2` AS sc2,
        c.`subBgrnd2` AS sb2,
        c.`subName3` AS sn3,
        c.`subColor3` AS sc3,
        c.`subBgrnd3` AS sb3,
        c.`subName4` AS sn4,
        c.`subColor4` AS sc4,
        c.`subBgrnd4` AS sb4,
        u.`name` AS una,
        g.`color` AS uco
    FROM `mycal_events` AS e
    INNER JOIN `mycal_categories` AS c ON c.`ID` = e.`catID`
    INNER JOIN `mycal_users` AS u ON u.`ID` = e.`userID`
    INNER JOIN `mycal_groups` AS g ON g.`ID` = u.`groupID`
    WHERE ((e.`aDateTime` NOT LIKE '9%' AND SUBSTR(e.`aDateTime`,1,10) >= '2019-09-05') OR (e.`mDateTime` NOT LIKE '9%' AND SUBSTR(e.`mDateTime`,1,10) >= '2019-09-05'))

**end of log entry

Any suggestions?  I am a novice when it comes to both php and sql.

Thanks for your help.

Bill

Re: SQL ERROR

Facing same problem, hope someone suggests a working solution.

Re: SQL ERROR

Hi there,

Please mention the LuxCal version you are using.

This looks like a MySQL server problem. I suggest to search the web for "General error: 2006 MySQL server has gone away".

I would advise calendar users, who are not familiar with a MySQL server to use the SQLite version of the LuxCal calendar. Much easier to manage and no drawbacks.

Roel

Re: SQL ERROR

If you ( or other users ) consider to shift to SQLite, then you can also "move" your existing data.

Here : http://calendarforum.dk/shift-database.html   you can see how.

The MySQL is only for those who have special needs or have really really many data. If you have a daily amount of more than 5000 events, and/or more than 10.000 users, then  the MySQL is recommended.

Re: SQL ERROR

**** IMPORTANT

Forgot to mention - if you migrate, then the system you are migrating from, and the system you are migrating to, should be the same version number.

You could upgrade to the newest version before migrating, or you could check the version you are currently running, and then contact Roel via the contact-page. I think he can supply an older version of the system, if you want to migrate to the same version as you have now.

Re: SQL ERROR

I am using version: 4.7.5M.  I tried installed the Lite version and when I run the lctools.php file I receive the following error: PHP PDO-SQLite extension NOT enabled. I contacted my ISP provider and they cannot install the extension on a shared environment. 

P.S. The lite version of the calendar did not install.

Re: SQL ERROR

Please try this : ( SQLite version )

1 - Create a new subdirectory.
2 - In this subdirectory upload the unzipped version of the calendar.
3 - In your browser "open" the subdirectory.
4 - You should be asked for a name you want for the admin, an email, and a wanted password.

Then/now your calendar should be ready for use. You should NOT have a need for the lctools.php??????

If one or more of the 1- 4 gives an error message then please tell.

It should not. I have installed the calendar ( SQLite version )  many times and on different servers/ISP's  - and have never seen an error when installing a non-beta version.

8 (edited by wrwbr549 2019-09-30 15:50:39)

Re: SQL ERROR

The address bar when executing item 3 changed to: http://www.gwvillage.com/gwvcal/install475.php

It displays at the top of the form the new calendars to install (populated with the defaults), in the middle of the form is shows installed calendars (No calendars installed in the specified folder, and at the bottom the fields for admin, email and password.

When I put in the admin name, email address, and password and pre the test button (the only button available), I receive the following error messages:

Tests failed:
PHP PDO-SQLite extension NOT enabled.
PHP sessions not working

Tests passed:
PHP version 7.3.7 OK
Form fields OK
Writing to the database folder 'db/'
Writing to the calendars' root folder
Writing to the 'files' folder
Writing an empty sql.log file to the 'logs' folder
Writing an empty luxcal.log file to the 'logs' folder

Thanks for the help,

Bill

Re: SQL ERROR

Maybe you have to look in the php.ini and see the settings for SQLite - but I think we now need help from an expert.
I guess Roel  will guide you to a solution.

Re: SQL ERROR

Oops, this is a long time ago.
If the PDO-SQLite extension cannot be enabled, then the only possibility left is the MySQL version of the calendar.
What worries me is the fact that also the PHP sessions are not working. The PHP sessions are used by the calendar and must be working.

If you are still stuck with this problem and interested in a solution, please let me know.

Roel

Re: SQL ERROR

The calendar is still generating SQL errors.  I'm not sure what you mean by the PHP sessions are not working.  I think you saw that in the post, that is timestamped 2019-09-30 09:41:20.

Every day the emails that I have set up to send are going out.  I have added my email address to every campaign.  I verify the number of emails received against the number of emails sent.  What I am not sure of, is everyone who is supposed to receive an email receiving them.

Any assistance regarding the SQL errors would be much appreciated.

Re: SQL ERROR

Hi Bill,

In your post of 2019-09-30, under Tests Failed, the second item says: PHP sessions not working.
But ok, if the emails are going out and if your calendar is working, then apparently the PHP sessions ARE working.

The SQL error in your first post is a

General error: 2006 MySQL server has gone away

This is not a syntax error, it's caused because for whatever reason the MySQL server doesn't respond anymore. It's very hard to say why this happens. From the SQL query string I can see that this happened when retrieving data from the calendar database. Because this function has not changed since years and never caused problems, I'm almost sure the problem has nothing to do with the calendar. If this problem happens often, if possible, I would suggest to open a ticket with your provider and ask if they can have a look in the server logs to see if they can find out why the "General error: 2006 MySQL server has gone away" errors occurred.

Roel