issue with db:init #341

Closed
opened 2026-02-04 18:36:07 +03:00 by OVERLORD · 8 comments
Owner

Originally created by @mahuntington on GitHub (Jun 27, 2023).

Hello! I'm running the manual install on my Debian 11 server. I'm running Postgres 13 and Node v18.12.1. I swear I followed the directions as written, but when I run npm run db:init && npm start --prod I get the following:

> db:init
> node db/init.js

Illegal instruction

My postgres tables look like this:

planka=# \d
                   List of relations
 Schema |           Name           |   Type   | Owner  
--------+--------------------------+----------+--------
 public | migration                | table    | planka
 public | migration_id_seq         | sequence | planka
 public | migration_lock           | table    | planka
 public | migration_lock_index_seq | sequence | planka
(4 rows)

planka=# SELECT * FROM migration;
 id | name | batch | migration_time 
----+------+-------+----------------
(0 rows)

planka=# SELECT * FROM migration_id_seq;
 last_value | log_cnt | is_called 
------------+---------+-----------
          1 |       0 | f
(1 row)

planka=# SELECT * FROM migration_lock;
 index | is_locked 
-------+-----------
     1 |         0
(1 row)

planka=# SELECT * FROM migration_lock_index_seq;
 last_value | log_cnt | is_called 
------------+---------+-----------
          1 |      32 | t
(1 row)

So it looks like it's breaking at some point during the migrations. As far as I could figure out, it seems to throw an error on line 11 of server/db/init.js:

await knex.migrate.latest();

Any suggestions? I was able to install on a docker container under similar conditions.

Originally created by @mahuntington on GitHub (Jun 27, 2023). Hello! I'm running the manual install on my Debian 11 server. I'm running Postgres 13 and Node v18.12.1. I swear I followed the directions as written, but when I run `npm run db:init && npm start --prod` I get the following: ``` > db:init > node db/init.js Illegal instruction ``` My postgres tables look like this: ``` planka=# \d List of relations Schema | Name | Type | Owner --------+--------------------------+----------+-------- public | migration | table | planka public | migration_id_seq | sequence | planka public | migration_lock | table | planka public | migration_lock_index_seq | sequence | planka (4 rows) planka=# SELECT * FROM migration; id | name | batch | migration_time ----+------+-------+---------------- (0 rows) planka=# SELECT * FROM migration_id_seq; last_value | log_cnt | is_called ------------+---------+----------- 1 | 0 | f (1 row) planka=# SELECT * FROM migration_lock; index | is_locked -------+----------- 1 | 0 (1 row) planka=# SELECT * FROM migration_lock_index_seq; last_value | log_cnt | is_called ------------+---------+----------- 1 | 32 | t (1 row) ``` So it looks like it's breaking at some point during the migrations. As far as I could figure out, it seems to throw an error on line 11 of server/db/init.js: ```javascript await knex.migrate.latest(); ``` Any suggestions? I was able to install on a docker container under similar conditions.
Author
Owner

@meltyshev commented on GitHub (Jul 4, 2023):

Hi! There seems to be something wrong with the driver binaries for the database. To be honest, I don't even know what to recommend and how to fix it. I would try deleting all the node_modules folders and running npm i again.

I found this description:

The Illegal Instruction message usually means that you have some binary which has invalid CPU instruction.

That could be for various reasons. For example, but not limited to:

  • Your compilation generated broken binary for your platform
  • Your system has bad binary from different architecture which it is trying to run
  • Your source code of Node.js has a bug (for example, integer overflow) which causes memory corruption and leads to Illegal Instruction
@meltyshev commented on GitHub (Jul 4, 2023): Hi! There seems to be something wrong with the driver binaries for the database. To be honest, I don't even know what to recommend and how to fix it. I would try deleting all the `node_modules` folders and running `npm i` again. I found this description: > The `Illegal Instruction` message usually means that you have some binary which has invalid CPU instruction. > > That could be for various reasons. For example, but not limited to: > > - Your compilation generated broken binary for your platform > - Your system has bad binary from different architecture which it is trying to run > - Your source code of Node.js has a bug (for example, integer overflow) which causes memory corruption and leads to `Illegal Instruction`
Author
Owner

@mahuntington commented on GitHub (Jul 4, 2023):

That’s a good idea. I reinstalled Postgres, but maybe it’s an issue with node or one of the packages. I’ll try reinstalling the app. Are there strict restrictions on what version of node to use with Planka? What about Postgres? I might try previous versions of those. The computer I’m using is a bit old, so maybe it will work with different versions of node/Postgres. Thanks for the help!

@mahuntington commented on GitHub (Jul 4, 2023): That’s a good idea. I reinstalled Postgres, but maybe it’s an issue with node or one of the packages. I’ll try reinstalling the app. Are there strict restrictions on what version of node to use with Planka? What about Postgres? I might try previous versions of those. The computer I’m using is a bit old, so maybe it will work with different versions of node/Postgres. Thanks for the help!
Author
Owner

@meltyshev commented on GitHub (Jul 4, 2023):

For the docker image we use LTS version of Node.js (18.x.x) and Postgres version 14. It seems like your versions should fit perfectly.

@meltyshev commented on GitHub (Jul 4, 2023): For the docker image we use LTS version of Node.js (18.x.x) and Postgres version 14. It seems like your versions should fit perfectly.
Author
Owner

@mahuntington commented on GitHub (Jul 4, 2023):

Hmmm. I tried Postgres v. 14 (I previously had v. 13), but still no luck. I'm going to try a fresh install of planka next. I think your docs are down, though: https://docs.planka.cloud/docs/installl-planka/Debian%20&%20Ubuntu

@mahuntington commented on GitHub (Jul 4, 2023): Hmmm. I tried Postgres v. 14 (I previously had v. 13), but still no luck. I'm going to try a fresh install of planka next. I think your docs are down, though: https://docs.planka.cloud/docs/installl-planka/Debian%20&%20Ubuntu
Author
Owner

@meltyshev commented on GitHub (Jul 4, 2023):

Thanks! It should be ok now 👌

@meltyshev commented on GitHub (Jul 4, 2023): Thanks! It should be ok now 👌
Author
Owner

@mahuntington commented on GitHub (Jul 5, 2023):

Well, I did a brand new install and nothing. Updated all the server packages and still nothing. 🤔

@mahuntington commented on GitHub (Jul 5, 2023): Well, I did a brand new install and nothing. Updated all the server packages and still nothing. 🤔
Author
Owner

@daniel-hiller commented on GitHub (Jul 5, 2023):

Hi,
I have tested the installation guide on debian 11
Everything is working just fine

cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
psql --version

psql (PostgreSQL) 13.11 (Debian 13.11-0+deb11u1)
node -v

v18.16.1

Here a Video of the whole installation process, maybe you can find something you missed.

@daniel-hiller commented on GitHub (Jul 5, 2023): Hi, I have tested the installation guide on debian 11 Everything is working just fine ``` cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" ``` ``` psql --version psql (PostgreSQL) 13.11 (Debian 13.11-0+deb11u1) ``` ``` node -v v18.16.1 ``` Here a [Video](https://www.youtube.com/watch?v=3IU56EPSOnI) of the whole installation process, maybe you can find something you missed.
Author
Owner

@mahuntington commented on GitHub (Jul 5, 2023):

Awesome. Thanks for the video. That's what I did. One thing I noticed, when messing around in a docker Debian container, was that I didn't need to create the user planka for the computer. It ran fine when I did everything as a different user as long as the planka directory was owned by that other user. I also noticed, again while in Docker, that I didn't need to cd into /tmp. Lastly, I was able to clone Planka into any directory as long as my symlinks were correct. Again, all this worked in Docker, but even when I do everything exactly as in the directions on the physical Debian server, it doesn't seem to work.

The one thing I didn't do was a fresh install of node. I previously had already installed Node v. 18.12.1, so I just used that. Perhaps installing a newer version of Node will help. I'll also add that the Debian computer I'm using is at least a few years old. I wonder if something is weird with its architecture.

@mahuntington commented on GitHub (Jul 5, 2023): Awesome. Thanks for the video. That's what I did. One thing I noticed, when messing around in a docker Debian container, was that I didn't need to create the user `planka` for the computer. It ran fine when I did everything as a different user as long as the planka directory was owned by that other user. I also noticed, again while in Docker, that I didn't need to `cd` into `/tmp`. Lastly, I was able to clone Planka into any directory as long as my symlinks were correct. Again, all this worked in Docker, but even when I do everything exactly as in the directions on the physical Debian server, it doesn't seem to work. The one thing I didn't do was a fresh install of node. I previously had already installed Node v. 18.12.1, so I just used that. Perhaps installing a newer version of Node will help. I'll also add that the Debian computer I'm using is at least a few years old. I wonder if something is weird with its architecture.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#341