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

Constant SQL_DATE already defined #820

Closed
zmiguel opened this issue Mar 30, 2019 · 9 comments
Closed

Constant SQL_DATE already defined #820

zmiguel opened this issue Mar 30, 2019 · 9 comments

Comments

@zmiguel
Copy link

zmiguel commented Mar 30, 2019

Running 0.14.1

I'm able to login to a server, but the sidebar is blank with an error "An error occured, check syslog for more information"

Syslog information is:

Mar 30 21:53:30 nginx movim[676]: movim.ERROR: Constant SQL_DATE already defined in /var/www/movim-0.14.1/src/Movim/Bootstrap.php (line 105)  [] []
Mar 30 21:53:30 nginx movim[391]: movim.ERROR: Constant SQL_DATE already defined in /var/www/movim-0.14.1/src/Movim/Bootstrap.php (line 105)  [] []
Mar 30 21:53:32 nginx movim[390]: movim.ERROR: Constant SQL_DATE already defined in /var/www/movim-0.14.1/src/Movim/Bootstrap.php (line 105)  [] []
Mar 30 21:53:32 nginx movim[676]: movim.ERROR: Constant SQL_DATE already defined in /var/www/movim-0.14.1/src/Movim/Bootstrap.php (line 105)  [] []

and keeps increasing every time I refresh the page

after starting the daemon:

Mar 30 21:57:02 nginx movim[3562]: PHP Notice:  Constant SQL_DATE already defined in /var/www/movim-0.14.1/src/Movim/Bootstrap.php on line 105
Mar 30 21:57:02 nginx movim[3562]: PHP Stack trace:
Mar 30 21:57:02 nginx movim[3562]: PHP   1. {main}() /var/www/movim-0.14.1/linker.php:0
Mar 30 21:57:02 nginx movim[3562]: PHP   2. Movim\Bootstrap->boot() /var/www/movim-0.14.1/linker.php:11
Mar 30 21:57:02 nginx movim[3562]: PHP   3. Movim\Bootstrap->setConstants() /var/www/movim-0.14.1/src/Movim/Bootstrap.php:23
Mar 30 21:57:02 nginx movim[3562]: PHP   4. define() /var/www/movim-0.14.1/src/Movim/Bootstrap.php:105
@edhelas
Copy link
Member

edhelas commented Apr 6, 2019

Does it still happen with master?
I can't find a way to reproduce it.

@Vertux
Copy link

Vertux commented Apr 13, 2019

I can confirm this issue. I just did a fresh install (git clone, master branch) on my Debian 9.8 system with postgresql v9.6.11 and PHP v7.2.17. When I start the daemon it throws the error:

An error occured, check syslog for more information
PHP Notice:  Constant SQL_DATE already defined in /var/www/vhosts/xxxx/xxxx/movim/src/Movim/Bootstrap.php on line 107
Movim daemon launched

Then it runs for about 3-5 seconds and then it crashes with this error:

Bildschirmfoto 2019-04-13 um 11 12 17

I think the two problems are related. Here are the database details just for reference

       Name         |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   |  Size   | Tablespace |                            
---------------------+----------+----------+-------------+-------------+-----------------------+---------+------------+
 movim               | movim    | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 8271 kB | pg_default |

EDIT: When I start the daemon with PHP 7.0.33-0+deb9u3 (cli), I see no error message and it does not crash.

@edhelas
Copy link
Member

edhelas commented Apr 16, 2019

Do you have any cache system enabled in the PHP config ?

@Vertux
Copy link

Vertux commented Apr 19, 2019

Do you have any cache system enabled in the PHP config ?

Yes, I have opcache.enable activated.

@edhelas
Copy link
Member

edhelas commented Apr 19, 2019

Can you try without it?

@Vertux
Copy link

Vertux commented Apr 19, 2019

I have disabled opcache for fpm and cli (PHP v7.2.17) but it had no effect.

@edhelas
Copy link
Member

edhelas commented Nov 5, 2019

I was not able to reproduce this issue since then. Closing the ticket.

@edhelas edhelas closed this as completed Nov 5, 2019
@Vertux
Copy link

Vertux commented Nov 24, 2019

I am sorry to mention this issue again, but It is pretty frustrating, with Movim v0.16 I get exactly the same error and behavior.

sudo -s -u xxxx php daemon.php start --url=https://xxx.xxx.de --port=8090
An error occured, check syslog for more information
Constant SQL_DATE already defined in /var/www/vhosts/xxx/src/Movim/Bootstrap.php (line 110)
Trace
PHP Notice:  Constant SQL_DATE already defined in /var/www/vhosts/xxx/src/Movim/Bootstrap.php on line 110
Movim daemon launched
Base URL: https://xxxx.xxxx.de/

And after 3-5sec the daemon crashes.

Bildschirmfoto 2019-11-24 um 11 05 49

It seems to be a systematic PHP problem, because the comand php composer.phar movim:migrate produces the same error/notice.

Is it possible, that it has something to do with the fact that I run PHP 7.2 on CLI and PHP 7.3 on the webserver? US and European ('DD-MM-YYYY') date/time format differ

The 'datetime' value assumes the "YYYY-MM-DD HH:MM:SS" formatting , any other format will not be accepted in the database.

but I cannot imagine that it triggers the crash.

Meanwhile my server is updated and I am running Plesk v18 - I have no issues with other (PHP) appications but Movim, I really want to hunting down the error.

Edit: I just tried to use MySQL (v10.1.41-MariaDB-0+deb9u1) instead of postgresql, which does not work:

sudo -s -u xxxxx php composer.phar movim:migrate
> vendor/bin/phinx migrate --ansi
Phinx by CakePHP - https://phinx.org. 0.11.1

using config file ./phinx.php
using config parser php
using migration paths
 - /var/www/vhosts/xxx/database/migrations
using seed paths
 - /var/www/vhosts/xxx/database/seeds
warning no environment specified, defaulting to: movim
using adapter mysql
using database movim

 == 20180314212906 CreateUrlsTable: migrating
PDOException: SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes. in /var/www/vhosts/xxx/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121
Stack trace:
[deleted]

I have tried this with two common database Kollation 'utf8_general_ci' and 'utf8mb4_general_ci' both does not work.

@edhelas
Copy link
Member

edhelas commented Nov 24, 2019

@Vertux would it be possible to know your JID then we can debug this together, you can add me directly edhelas _ at _ movim _ dot _ eu ?

@edhelas edhelas reopened this Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants