Problem with installation - not allowed to connect to this MySQL server

Hello,

  1. I’m working on virtual ubuntu 18.04 server.
  2. I have a user for ForestAdmin on mysql
  3. I access to my DB via console
  4. I’m installing Forest with Docker container
    docker pull forestadmin/lumber
    docker run
    -v pwd:/usr/src/app --init
    -e DATABASE_URL=“mysql://TufFA:1Forest%21B@212.80.205.45:3306/Tufinit”
    -e DATABASE_SSL=“false”
    -e APP_NAME="ProcessControl "
    -e FOREST_EMAIL=“marina@tufinit.co.il”
    -e FOREST_TOKEN=“eyJraWQiOiJ6d0VjbU5LVVpVTkdYUnlNRzZ2QUoyTTVfYzBoZGhfblBXS0hYWjhGUTFBIiwiYWxnIjoiUlMyNTYifQ.eyJkYXRhIjp7ImRhdGEiOnsidHlwZSI6InVzZXJzIiwiaWQiOiI0NzExNSIsImF0dHJpYnV0ZXMiOnsiZmlyc3RfbmFtZSI6Ik1hcmluYSIsImxhc3RfbmFtZSI6IkxldnkiLCJlbWFpbCI6Im1hcmluYUB0dWZpbml0LmNvLmlsIn19fSwiaXNBcHBsaWNhdGlvblRva2VuIjp0cnVlLCJhdWQiOiJGT1JFU1RfVVNFUlMiLCJpc3MiOiJGT1JFU1RfQVVUSEVOVElDQVRJT05fU1lTVEVNIiwiaWF0IjoxNjIwODE2Mzk5LCJleHAiOjE2MjA5ODkxMjh9.Swe1XdaqMBr5N9mDsGQcxHmeHJc9SyfEyWbChAhjyswBVZf6PkdKTo7SJuxUsL07BWzqrlVhWgV_mt615AazgahPPg3O4hHL7_YMc1oVFWNivAjOVo17V76tx9EqNfiFLKZspwHj0WT_sPddg1d6qdjyyWwudZijTJLqW_dBNzs6Y5MibG88J9o6QR74i9cmWcnxX16eS7JyLqk7xOCKFF_FTzhGa_hCb8c-NmWEgsMMAqyeT2ddeh8vdMSHQhgcq37pP0Um1czYKtZUztVv1BY2Gl3TdQyfVUiYXQg64NURz2cjGLzjv2DuhIQHXV3ejIeGPQNQV_SF_yuKcGMBQw”
    -e APPLICATION_HOST=“localhost”
    -e APPLICATION_PORT=“3310”
    -ti forestadmin/lumberUsing default tag: latest

latest: Pulling from forestadmin/lumber
Digest: sha256:05023f7eeca29b9a94fdd14decd78a17af0b5f875dc49a121a9bfc336e9d34dd
Status: Image is up to date for forestadmin/lumber:latest
docker.io/forestadmin/lumber:latest
root@tufinit_1:~# docker run \

-v pwd:/usr/src/app --init
-e DATABASE_URL=“mysql://TufFA:1Forest%21B@212.80.205.45:3306/Tufinit”
-e DATABASE_SSL=“false”
-e APP_NAME="ProcessControl "
-e FOREST_EMAIL=“marina@tufinit.co.il”
-e FOREST_TOKEN=“eyJraWQiOiJ6d0VjbU5LVVpVTkdYUnlNRzZ2QUoyTTVfYzBoZGhfblBXS0hYWjhGUTFBIiwiYWxnIjoiUlMyNTYifQ.eyJkYXRhIjp7ImRhdGEiOnsidHlwZSI6InVzZXJzIiwiaWQiOiI0NzExNSIsImF0dHJpYnV0ZXMiOnsiZmlyc3RfbmFtZSI6Ik1hcmluYSIsImxhc3RfbmFtZSI6IkxldnkiLCJlbWFpbCI6Im1hcmluYUB0dWZpbml0LmNvLmlsIn19fSwiaXNBcHBsaWNhdGlvblRva2VuIjp0cnVlLCJhdWQiOiJGT1JFU1RfVVNFUlMiLCJpc3MiOiJGT1JFU1RfQVVUSEVOVElDQVRJT05fU1lTVEVNIiwiaWF0IjoxNjIwODE2Mzk5LCJleHAiOjE2MjA5ODkxMjh9.Swe1XdaqMBr5N9mDsGQcxHmeHJc9SyfEyWbChAhjyswBVZf6PkdKTo7SJuxUsL07BWzqrlVhWgV_mt615AazgahPPg3O4hHL7_YMc1oVFWNivAjOVo17V76tx9EqNfiFLKZspwHj0WT_sPddg1d6qdjyyWwudZijTJLqW_dBNzs6Y5MibG88J9o6QR74i9cmWcnxX16eS7JyLqk7xOCKFF_FTzhGa_hCb8c-NmWEgsMMAqyeT2ddeh8vdMSHQhgcq37pP0Um1czYKtZUztVv1BY2Gl3TdQyfVUiYXQg64NURz2cjGLzjv2DuhIQHXV3ejIeGPQNQV_SF_yuKcGMBQw”
-e APPLICATION_HOST=“localhost”
-e APPLICATION_PORT=“3310”
-ti forestadmin/lumber
(node:9) ExperimentalWarning: The dns.promises API is experimental
(node:16) ExperimentalWarning: The dns.promises API is experimental
:heavy_multiplication_x: Connecting to your database
Cannot connect to the database due to the following error:
SequelizeConnectionRefusedError: connect ECONNREFUSED 212.80.205.45:3306

@MarinaLevy,

When you say you have access to the database “via console”, do you mean that once connected to the server via SSH (with putty or any client) you can connect to the database?

From what I see in the error message connect ECONNREFUSED 212.80... my guess is that the port 3306 is open for local connection, but not from another server.

If so, you might need to open it in you server firewall (like this with ufw).

You may also need to tell you MySQL server to allow connections from outside (like this).

I’ve made all the required changes and finished the installation. Now it stack for long time in the backend stage. What I should do?

Hi @MarinaLevy, these logs indicate that your server is running. You should now be able to access your project through the following URL: https://app.forestadmin.com

I still can’t access
ForestAdmin2
and the installation is still telling: waiting for backend to run
ForestAdmin3

@MarinaLevy I’m sorry to hear that it is still not working for you.

Could you please share with me the content and response of the request sent to your server. I would also need the logs on your running server

I would love to.
How can I do it? (I’m not an IT expert :frowning:

On your browser, open the console: right click > inspect

On the network tab, when trying to authenticate, you should see a failing request, in red, when clicking on it, you should have a right panel that will open and look like this:

Screenshot 2021-05-20 at 12.21.41

Could you share it with me?

Also, your server should be running in a terminal (the same as your last screenshot). When the request fails, there should be logs displayed in that console. I’ll need you to share those too.

Thank you :slight_smile:

Hi, I’ve opened the browser console, but didn’t find the inspect bar.

Also, in the console i did $dmesg and got this:

[2746552.059406] [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:1a:1d:b9:98:5d:82:11:c5:59:08:00 SRC=101.132.75.186 DST=212.80.205.45 LEN=40 TOS=0x00 PREC=0x00 TTL=239 ID=58155 PROTO=TCP SPT=59770 DPT=6463 WINDOW=1024 RES=0x00 SYN URGP=0

Hey @MarinaLevy,

You shared a screen from the Console Tab. As you’re not familiar with IT expert tools I share you this video explaining the network tab. In order to understand what’s going on on your side with need to have a capture of the following calls:

  • /forest/authentication
  • forest/authentication/callback?

Thank you in advance :slight_smile:
Morgan

Thank you for tutorial, it was really helpful


I find the “/forest/authentication”, but did’t find “forest/authentication/callback?”

Forest Admin 🌲 Start third-party services tracking.
vendor-870b591254c57b2e9f8eef53319b516c.js:19450 Disable custom header forest-environment-id, forest-project-id as it is not allowed by the client
vendor-870b591254c57b2e9f8eef53319b516c.js:19450 Drift has already been initialized.
vendor-870b591254c57b2e9f8eef53319b516c.js:19450 Forest Admin 🌲 Start Drift tracking.
vendor-870b591254c57b2e9f8eef53319b516c.js:19469 POST http://localhost:3310/forest/authentication net::ERR_CONNECTION_REFUSED
Show 40 more frames
vendor-870b591254c57b2e9f8eef53319b516c.js:19365 WebSocket connection to 'wss://forestadmin-server.herokuapp.com/subscriptions' failed: WebSocket is closed before the connection is established.

Hey @MarinaLevy,

Happy that helps you. It’s normal that you couldn’t find forest/authentication/callback call since forest/authentication/ failed in the first place. I still miss some bit off informations to help you.

As you can see you have 2 red lines: One is the forest/authentication/ POST call the other is the forest/authentication/ OPTIONS call.

Can you click on those failling forest/authentication/ calls and share the HEADER configurations ?

Also, have you any logs on your agent (backend) ?

Regards,
Morgan

Is that what you need?


Also, the logs on the backend are probably exists, but can you help me to find them?
Its on Ubuntu 18.04

If you click on the line you will have a more detailed view. :slight_smile:

Screenshot 2021-05-26 at 10.27.13

Maybe your backend is not running at all. You should have a terminal with your backend running.

Did it!
:slight_smile:

Great. :muscle:
It seems your backend is not running at all. Can you share me your terminal with your project running ?

To run your backend just go to your project folder and run npm start

How can I share it with you?

root@tufinit_1:~/ProcessControl # npm start

processcontrol@0.0.1 start /root/ProcessControl
node ./server.js

/root/ProcessControl /node_modules/jose/lib/help/rsa_primes.js:6
const ZERO = BigInt(0)
^

ReferenceError: BigInt is not defined
at Object. (/root/ProcessControl /node_modules/jose/lib/help/rsprimes.js:6:14)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/root/ProcessControl /node_modules/jose/lib/help/keutils.js:9:23)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)

npm ERR! Linux 4.15.0-45-generic
npm ERR! argv “/usr/bin/node” “/usr/bin/npm” “start”
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! processcontrol@0.0.1 start: node ./server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the processcontrol@0.0.1 start script ‘node ./server.js’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the processcontrol packe,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./server.js
npm ERR! You can get information on how to open an issue for this project with
npm ERR! npm bugs processcontrol
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls processcontrol
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/ProcessControl /npm-debug.log

You’re using docker… I just rewrote the thread. Very sorry.

Is your docker running ? You can use the following docker ps -a to see running containers.

root@tufinit_1:~/ProcessControl # docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
edef58ac9e33 processcontrol_app “docker-entrypoint.s…” 6 days ago Exited (0) 3 days ago process_control