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

Fatal error: Uncaught Error: Call to a member function execute() #71

Closed
shmilylty opened this issue Oct 26, 2020 · 9 comments
Closed

Fatal error: Uncaught Error: Call to a member function execute() #71

shmilylty opened this issue Oct 26, 2020 · 9 comments
Assignees
Labels

Comments

@shmilylty
Copy link

When I followed wiki's instructions to install ezxss, the following error occurred when accessing exss.
https://github.com/ssl/ezXSS/wiki/Installation#installation-with-docker-compose

Fatal error: Uncaught Error: Call to a member function execute() on bool in /var/www/html/src/Database.php:64 Stack trace: #0 /var/www/html/src/Database.php(91): Database->fetchAll('SELECT setting,...', Array) #1 /var/www/html/src/Route.php(331): Database->fetchSetting('killswitch') #2 /var/www/html/src/Route.php(31): Route->verifySettings() #3 /var/www/html/init.php(86): Route->__construct() #4 {main} thrown in /var/www/html/src/Database.php on line 64
@GlitchWitch
Copy link
Contributor

Hi @shmilylty, please share the following information to help us troubleshoot.

What version of ezxss are you trying to install?
What version of docker-compose are you using docker-compose --version?
Can you post the output of docker-compose up without the -d flag?

Thanks

@shmilylty
Copy link
Author

docker-compose --version

docker-compose version 1.27.4, build 40524192

docker-compose up

Creating ezxssdb ... done
Creating ezxss_ezxss_1 ... done
Attaching to ezxssdb, ezxss_ezxss_1
ezxssdb    | 2020-10-26 05:21:23+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
ezxssdb    | 2020-10-26 05:21:23+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
ezxssdb    | 2020-10-26 05:21:23+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
ezxssdb    | 2020-10-26T05:21:24.938402Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22) starting as process 1
ezxssdb    | 2020-10-26T05:21:24.972059Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
ezxss_1    | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message
ezxss_1    | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message
ezxss_1    | [Mon Oct 26 05:21:25.212033 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.11 configured -- resuming normal operations
ezxss_1    | [Mon Oct 26 05:21:25.221081 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
ezxssdb    | 2020-10-26T05:21:25.457776Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
ezxssdb    | 2020-10-26T05:21:25.616664Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
ezxssdb    | 2020-10-26T05:21:25.722046Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
ezxssdb    | 2020-10-26T05:21:25.722945Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
ezxssdb    | 2020-10-26T05:21:25.726771Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosinga different directory.
ezxssdb    | 2020-10-26T05:21:25.751611Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.22'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.

docker ps -a

CONTAINER ID        IMAGE                         COMMAND                  CREATED              STATUS                    PORTS                                                          NAMES
70636c53538c        ezxss_ezxss                   "docker-php-entrypoi…"   About a minute ago   Up About a minute         127.0.0.1:8080->80/tcp, 127.0.0.1:4443->443/tcp                ezxss_ezxss_1
d7b00d9a709f        mysql                         "docker-entrypoint.s…"   About a minute ago   Up About a minute         3306/tcp, 33060/tcp                                            ezxssdb

@GlitchWitch
Copy link
Contributor

Thanks @shmilylty.

I was able to replicate the error using the same setup/version. It seems it's not exclusive to docker but rather a recent code change in ezxss 3.9. Try again with ezxss version 3.8 and let me know if it this works for you.

@shmilylty
Copy link
Author

There is no problem using docker to build version 3.8 before, please fix this bug, I want to use the latest version, thank you.

@GlitchWitch
Copy link
Contributor

GlitchWitch commented Oct 26, 2020

@shmilylty Try again with version 3.9 but this time in Database.php change line 62 from

$this->DB->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

to

$this->DB->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);

This seemed to solve the issue in my test case, however I am not 100% if this is secure. @ssl will need to weigh in.

@shmilylty
Copy link
Author

It can be used normally after modification.

@GlitchWitch
Copy link
Contributor

GlitchWitch commented Oct 26, 2020

Glad to hear, keep in mind this is definitely not a permanent fix but rather a temporary one until a proper fix is pushed. It would probably be best to stick with version 3.8 for now until a full fix is released by @ssl.

@shmilylty
Copy link
Author

We look forward to your release of the repaired version.

@ssl ssl self-assigned this Oct 26, 2020
@ssl ssl added the bug label Oct 26, 2020
@ssl
Copy link
Owner

ssl commented Oct 26, 2020

Fixed this in 9e91b20 - thanks for letting me know!

@ssl ssl closed this as completed Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants