Post only error "Request not understood error, cannot list posts. could not understand request."

I’ve installed Ghost successfully except for this one issue of posts not working. I get 400 error with a red banner saying "Request not understood error, cannot list posts. could not understand request. "

For the sake of simplicity of communication, I’ve attached a link with a video showing the problem here: Screen recording of error

- What’s your URL?

- What version of Ghost are you using?
Ghost-CLI version: 1.23.1
Ghost version: 5.21.0

- What configuration?
Ubuntu 20.04 with CyberPanel (non nginx) MariaDB and Cloudflare

- What browser?
Chrome, Firefox, Brave.

  • What errors or information do you see in the console?

- What steps could someone else take to reproduce the issue you’re having?

I followed the instructions here: How to install Ghost alongside CyberPanel on Ubuntu 20.04 without Docker

Everything works great without any problems, I can even make pages. it’s literally just the posts getting this 400 error that is the issue. As you can see also when I click on the post tabs you see the dashboard show for a very brief moment, then it goes away with the 400 error.

Any advice is appreciated. Thank you in advance to anyone kind enough to help.

Hi @dennisthemenace, Ghost v5 does not support MariaDB. You can find a lot of info about how to switch to MySQL 8 by searching the forum.

MariaDB is the whole setup with Cyberpanel so cant I just downgrade somehow to a lower version than Ghost V5 to solve the problem?

Ghost 5.20.0 works with Maria. 5.21.0 is what caused the breakage. You could stay on 5.20.0 until you can swap to MySQL8 or a patch happens to make it into knex that resolves that specific issue.

That’s great I’ll downgrade to 5.20.0

Any idea how to do that with the CLI?

I don’t mind starting the website again because it’s new.

I believe it was ghost update --rollback and that will take you back from last minor version.

But this only applies if you started with an earlier version and installed 5.0 as an update. I started with the latest version stated in my original post so what do I do in my scenario to go to that ideal version that allows MariaDB in the easiest possible way? As I mentioned before also I am happy to start fresh if that’s the solution but I’d need to know how to select the correct version that allows MariaDB and also how to ensure that it selects mariadb and not MySQL somehow too. Thanks for any advice you can give me.

Update Edit: since it’s a fresh install I’ll just try reinstalling it using --version=5.20.0 and see if it helps. I’ll report if it does/doesn’t.

Update 2: Solved with this addition of --version=5.20.0 after trashing the original version of the website and reinstalling. Thanks!! :)

Many open source panels use MariaDB as defaults and you say that we need to use mysql 8 to use Ghost CMS. You may right if only installed ghost cms on the server but there are another softwares also. We can not use MYSQL and MariaDB at the same time. You should support postgresql or docker as officially. You create dilemma. I have to change whole database system just for ghost cms because of this decision. I hope you change your idea. Also your installation steps are not available for every panels. For examples I use HestiaCP and its NGINC conf. folder is different or website folder. Your setup is loooking for var/www/sites. Hestia use home/user/domain.com/public_html/ for web path. You dont give support for docker as official and this limit many users.

why not? have you tried? Just to prove that it is possible:

hans@cac3:~$ cat /etc/*release* | head -4
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"
hans@cac3:~$ mkdir test
hans@cac3:~$ cd test
hans@cac3:~/test$ mkdir mysql
hans@cac3:~/test$ cd mysql/
hans@cac3:~/test/mysql$ mkdir datadir
hans@cac3:~/test/mysql$ wget 'https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz';
--2023-07-23 16:03:53--  https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz
Resolving dev.mysql.com (dev.mysql.com)... 184.86.41.128, 2600:140a:0:69b::2e31, 2600:140a:0:682::2e31
Connecting to dev.mysql.com (dev.mysql.com)|184.86.41.128|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz [following]
--2023-07-23 16:03:53--  https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz
Resolving cdn.mysql.com (cdn.mysql.com)... 23.216.84.226
Connecting to cdn.mysql.com (cdn.mysql.com)|23.216.84.226|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 610315332 (582M) [text/plain]
Saving to: ‘mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz’

mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz                          100%[==================================================================================================================================================================>] 582.04M  75.4MB/s    in 8.8s

2023-07-23 16:04:02 (66.4 MB/s) - ‘mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz’ saved [610315332/610315332]

hans@cac3:~/test/mysql$ tar xf mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz
hans@cac3:~/test/mysql$ cd mysql-8.0.32-linux-glibc2.12-x86_64/
bin  docs  include  lib  LICENSE  man  README  share  support-files
hans@cac3:~/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64$ nano my.cnf
[mysqld]
socket = /home/hans/test/mysql/mysqld.sock
skip_networking = 1
max_connections = 20
disable-log-bin = 1
skip-name-resolve = 1
performance-schema = 0
mysqlx = 0
max_allowed_packet = 50M
innodb_buffer_pool_size = 8M
innodb_buffer_pool_instances = 1
datadir = /home/hans/test/mysql/datadir

hans@cac3:~/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64$ ./bin/mysqld --defaults-file=./my.cnf --initialize-insecure
2023-07-23T16:07:40.884830Z 0 [System] [MY-013169] [Server] /home/hans/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.32) initializing of server in progress as process 657947
2023-07-23T16:07:40.900041Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-07-23T16:07:44.047090Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-07-23T16:07:49.932629Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

hans@cac3:~/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64$ ./bin/mysqld --defaults-file=./my.cnf &
[1] 658166
hans@cac3:~/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64$ 2023-07-23T16:08:35.314238Z 0 [System] [MY-010116] [Server] /home/hans/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64/bin/mysqld (mysqld 8.0.32) starting as process 658166
2023-07-23T16:08:35.320343Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-07-23T16:08:35.840163Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-07-23T16:08:37.344209Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-07-23T16:08:37.344267Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-07-23T16:08:37.428006Z 0 [System] [MY-010931] [Server] /home/hans/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64/bin/mysqld: ready for connections. Version: '8.0.32'  socket: '/home/hans/test/mysql/mysqld.sock'  port: 0  MySQL Community Server - GPL.

hans@cac3:~/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64$

50% success! now we have MySQL running in the background! now to get MariaDB to run in the background as well:

hans@cac3:~/test/mysql/mysql-8.0.32-linux-glibc2.12-x86_64$ cd ~/test/
mysql
hans@cac3:~/test$ mkdir mariadb
hans@cac3:~/test$ cd mariadb/
hans@cac3:~/test/mariadb$ mkdir datadir
hans@cac3:~/test/mariadb$ wget 'https://archive.mariadb.org/mariadb-11.0.2/bintar-linux-systemd-x86_64/mariadb-11.0.2-linux-systemd-x86_64.tar.gz'
--2023-07-23 16:11:30--  https://archive.mariadb.org/mariadb-11.0.2/bintar-linux-systemd-x86_64/mariadb-11.0.2-linux-systemd-x86_64.tar.gz
Resolving archive.mariadb.org (archive.mariadb.org)... 138.201.152.105, 2a01:4f8:c17:cad6::1
Connecting to archive.mariadb.org (archive.mariadb.org)|138.201.152.105|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 346184990 (330M) [application/octet-stream]
Saving to: ‘mariadb-11.0.2-linux-systemd-x86_64.tar.gz’

mariadb-11.0.2-linux-systemd-x86_64.tar.gz                          100%[==================================================================================================================================================================>] 330.15M  6.47MB/s    in 36s

2023-07-23 16:12:06 (9.25 MB/s) - ‘mariadb-11.0.2-linux-systemd-x86_64.tar.gz’ saved [346184990/346184990]

hans@cac3:~/test/mariadb$ tar xf mariadb-11.0.2-linux-systemd-x86_64.tar.gz
hans@cac3:~/test/mariadb$ cd mariadb-11.0.2-linux-systemd-x86_64/
bin  COPYING  CREDITS  docs  include  INSTALL-BINARY  lib  man  mysql-test  README.md  README-wsrep  scripts  share  sql-bench  support-files  THIRDPARTY
hans@cac3:~/test/mariadb/mariadb-11.0.2-linux-systemd-x86_64$ nano my.cnf
[mysqld]
socket = /home/hans/test/mariadb/mariadbd.sock
skip_networking = 1
max_connections = 20
disable-log-bin = 1
skip-name-resolve = 1
performance-schema = 0
max_allowed_packet = 50M
innodb_buffer_pool_size = 8M
innodb_buffer_pool_instances = 1
datadir = /home/hans/test/mariadb/datadir

hans@cac3:~/test/mariadb/mariadb-11.0.2-linux-systemd-x86_64$ ./scripts/mariadb-install-db --auth-root-authentication-method=normal --defaults-file=./my.cnf
Installing MariaDB/MySQL system tables in '/home/hans/test/mariadb/datadir' ...
2023-07-23 16:29:05 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
OK

To start mariadbd at boot time you have to copy
support-files/mariadb.service to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following command:

'./bin/mariadb-secure-installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at https://mariadb.com/kb

You can start the MariaDB daemon with:
cd '.' ; ./bin/mariadb-safe --datadir='/home/hans/test/mariadb/datadir'

You can test the MariaDB daemon with mariadb-test-run.pl
cd './mysql-test' ; perl mariadb-test-run.pl

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.

Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

hans@cac3:~/test/mariadb/mariadb-11.0.2-linux-systemd-x86_64$ ./bin/mariadbd --defaults-file=./my.cnf &
[2] 661169
hans@cac3:~/test/mariadb/mariadb-11.0.2-linux-systemd-x86_64$ 2023-07-23 16:30:00 0 [Note] Starting MariaDB 11.0.2-MariaDB source revision 0005f2f06c8e1aea4915887decad67885108a929 as process 661169
2023-07-23 16:30:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2023-07-23 16:30:00 0 [Note] InnoDB: Number of transaction pools: 1
2023-07-23 16:30:00 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-07-23 16:30:00 0 [Note] InnoDB: Using Linux native AIO
2023-07-23 16:30:00 0 [Note] InnoDB: Initializing buffer pool, total size = 8.000MiB, chunk size = 1.000MiB
2023-07-23 16:30:00 0 [Note] InnoDB: Completed initialization of buffer pool
2023-07-23 16:30:00 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2023-07-23 16:30:00 0 [Note] InnoDB: Opened 3 undo tablespaces
2023-07-23 16:30:00 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2023-07-23 16:30:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-07-23 16:30:00 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-07-23 16:30:00 0 [Note] InnoDB: log sequence number 47139; transaction id 14
2023-07-23 16:30:00 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-07-23 16:30:00 0 [Note] Plugin 'wsrep-provider' is disabled.
2023-07-23 16:30:00 0 [Note] InnoDB: Loading buffer pool(s) from /home/hans/test/mariadb/datadir/ib_buffer_pool
2023-07-23 16:30:00 0 [Warning] 'innodb-buffer-pool-instances' was removed. It does nothing now and exists only for compatibility with old my.cnf files.
2023-07-23 16:30:00 0 [Note] InnoDB: Buffer pool(s) load completed at 230723 16:30:00
2023-07-23 16:30:00 0 [Warning] 'user' entry 'root@cac3.loltek.net' ignored in --skip-name-resolve mode.
2023-07-23 16:30:00 0 [Warning] 'user' entry '@cac3.loltek.net' ignored in --skip-name-resolve mode.
2023-07-23 16:30:00 0 [Warning] 'proxies_priv' entry '@% root@cac3.loltek.net' ignored in --skip-name-resolve mode.
2023-07-23 16:30:00 0 [Note] ./bin/mariadbd: ready for connections.
Version: '11.0.2-MariaDB'  socket: '/home/hans/test/mariadb/mariadbd.sock'  port: 0  MariaDB Server

Success! now we have both MySQL and MariaDB running side-by-side, with MySQL listening on /home/hans/test/mysql/mysqld.sock and MariaDB listening on /home/hans/test/mariadb/mariadbd.sock , and to prove that they both work, we run this little php script:

hans@cac3:~/test/mariadb/mariadb-11.0.2-linux-systemd-x86_64$ nano test.php
<?php
declare(strict_types=1);
$mysql = new PDO('mysql:unix_socket=/home/hans/test/mysql/mysqld.sock', 'root', '', array(
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
));
$mariadb = new PDO('mysql:unix_socket=/home/hans/test/mariadb/mariadbd.sock', 'root', '', array(
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
));
var_dump($mysql->query("SELECT VERSION()")->fetchAll());
var_dump($mariadb->query("SELECT VERSION()")->fetchAll());

and the final proof:

hans@cac3:~/test/mariadb/mariadb-11.0.2-linux-systemd-x86_64$ php test.php
array(1) {
  [0]=>
  array(2) {
    ["VERSION()"]=>
    string(6) "8.0.32"
    [0]=>
    string(6) "8.0.32"
  }
}
array(1) {
  [0]=>
  array(2) {
    ["VERSION()"]=>
    string(14) "11.0.2-MariaDB"
    [0]=>
    string(14) "11.0.2-MariaDB"
  }
}
  • TL;DR: MySQL and MariaDB can run side-by-side, as long as they use separate data-dirs and separate ports :slight_smile:

  • (in this example, i didn’t use any ports at all, but unix sockets instead of tcp ports, because it makes authentication easier)