Unable to authenticate

Expected behavior

Connection to Forest Admin on our stagging environment

Actual behavior

Once connected, when I choose the environment I’ve this issue :
“Unable to authenticate you
Please verify that your admin backend is correctly configured and running, and that you have access to the internet.”

Failure Logs

Don’t have any log, but when I go directly to the Admin backend URL I arrived on a 403 forbiden. That can be the reason ?

SSL is activated on the URL.

Context

Please provide any relevant information about your setup.

  • Project Name: Lightyshare V2
  • Liana Version : 8.0.5

Hello @Jonathan and welcome back,

Is there any response from the called that responds a 403? Can you please check your backend logs to see if there are any relevant additional logs?

Also can you share to me the network request that is failing from the network tab of your browser dev tool? :slight_smile:

Kind regards,

Thanks for the fast reply !

I’m not sure to understand your first question, and we don’t have anything related in the logs, or we don’t know where to look :confused:

This is the network request :


Preview is giving me a “Failed to load response data”.

My first question is about the logs on your server side (like Heroku or on AWS depending where your servers are hosted :slight_smile: ) And I suppose there will be more information there.

Have you done something recently that could broke the link to Forest? :slight_smile:

This is a new project, we worked on local before, so it’s first time on our server.

This is the log we found :

Action reload started
Action reload completed
Error: Cannot find module '/home/forest-preprod/public_html/ForestAdmin'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

In order to assist you, I would need some additional information.

  • Could you please check that you run the npm install -s command and that it was successful?
  • If yes , can you please run ls command in the project root folder and confirm that you have the node_modules folder present?

Thank you :slight_smile:

Hi Iclisson, I work with Jonathan and this log was on PM2 instance … I’ve run pm2 start server.js and now it’s working and I don’t have this logs below again. But it still doesn’t happen nothings on forestAdmin side…

I’ve found this error_logs for nginx :

2021/09/02 10:40:27 [error] 21916#21916: *1 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 10:40:40 [error] 21916#21916: *1 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 10:40:41 [error] 21916#21916: *1 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 10:40:42 [error] 21916#21916: *1 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 10:40:42 [error] 21916#21916: *1 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 10:46:19 [error] 21916#21916: *8 open() "/home/forest-preprod/public_html/ForestAdmin/owa/auth/logon.aspx" failed (2: No such file or directory), client: 192.241.213.188, server: front-preprod.lightyshare.com, request: "GET /owa/auth/logon.aspx?url=https%3a%2f%2f1%2fecp%2f HTTP/1.1", host: "212.129.16.10"

2021/09/02 10:47:32 [error] 21916#21916: *9 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 10:47:34 [error] 21916#21916: *9 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 10:47:35 [error] 21916#21916: *9 directory index of "/home/forest-preprod/public_html/ForestAdmin/" is forbidden, client: 37.164.251.184, server: front-preprod.lightyshare.com, request: "GET / HTTP/1.1", host: "forest-preprod.lightyshare.com"

2021/09/02 11:40:23 [error] 21916#21916: *13 connect() failed (111: Connection refused) while connecting to upstream, client: 81.214.185.130, server: forest-preprod.lightyshare.com, request: "GET / HTTP/1.0", upstream: "http://[::1]:3000/", host: "212.129.16.10"

2021/09/02 11:40:23 [error] 21916#21916: *13 connect() failed (111: Connection refused) while connecting to upstream, client: 81.214.185.130, server: forest-preprod.lightyshare.com, request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:3000/", host: "212.129.16.10"

2021/09/02 11:44:39 [error] 21916#21916: *16 connect() failed (111: Connection refused) while connecting to upstream, client: 139.162.231.225, server: forest-preprod.lightyshare.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "212.129.16.10"

2021/09/02 11:44:39 [error] 21916#21916: *16 connect() failed (111: Connection refused) while connecting to upstream, client: 139.162.231.225, server: forest-preprod.lightyshare.com, request: "GET / HTTP/1.1", upstream: "http://[::1]:3000/", host: "212.129.16.10"

root has logged off pts/2 from 37.164.251.184.

So I would need the logs on your server side to understand a bit more on what is happening under the hood :slight_smile:

Have you checked that your nodes_modules are well installed?

Thanks

yes nodes_modules is well installed and console show :

Your application is listening on port 3310.
Your admin panel is available here: https://app.forestadmin.com/projects

after npm run start and pm2 start server.js

An error 502 sent by nginx means that the server does not respond to the request.

  • Is nginx correctly configure to redirect calls to /forest/authentication to your node app ?
  • Is nginx correctly configured to redirect traffic to the same port your node app is listening to?

The agent itself never returns a 502, this error is sent by your reverse proxy to indicate that it could not contact the server.
You can test your setup by displaying this url directly in your browser:
https://forest-preprod.lightyshare.com/forest

When your server returns a 204, it means that the agent is correctly getting the call and responding to it.

If I’m calling your url, I get a 502 error even on this URL. It means that it’s not related to the authentication but to your setup (reverse proxy/agent).

Regards

Thx for your fast reply, there is my defaut nginx config :


server {
        listen 443 ssl;
        listen [::]:443;

	ssl on;
	ssl_certificate /home/forest-preprod/ssl.cert;
	ssl_certificate_key /home/forest-preprod/ssl.key;
	server_name www.forest-preprod.lightyshare.com forest-preprod.lightyshare.com;

	location / {
                proxy_pass http://localhost:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
        }

}

server {
	listen 80;

	# SSL configuration
	#
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	# Add index.php to the list if you are using PHP
	index index.html index.htm index.nginx-debian.html;

	server_name forest-preprod.lightyshare.com;
	error_log /home/forest-preprod/logs/error_log;
	access_log /home/forest-preprod/logs/access_log;

	return 301 https://$host$request_uri;
}

I’m not very experienced with nginx configuration but I’ll try to help!

You set your proxy_pass at http://localhost:3000 but would not it be the same as your forest admin server? (i.e http://localhost:3310)

Is your certificate still good?

1 Like

Great :tada: it was the port :wink: welldone thank you
But now i’ve got a new error in nodejs server :

GET /forest/authentication/callback?code=wlXnGZ3uXvPGgEach25tjCvWiAg_61goALnOa1RjoB-s-bLrI3eRup5UkwpR4jJJ&state=%7B%22renderingId%22%3A98429%7D 200 531 - 555.757 ms
OPTIONS /forest/demandeAjoutModele?timezone=Europe%2FParis&fields%5Bcategorie%5D=nom&fields%5BdemandeAjoutModele%5D=id%2Cmarque%2Ccreated_at%2Cmodele%2Cuser%2Ccategorie%2CsousCategorie&fields%5BsousCategorie%5D=nom&fields%5Buser%5D=nomcomplet&page%5Bnumber%5D=1&page%5Bsize%5D=15&searchExtended=0&sort=-id 204 0 - 0.258 ms
OPTIONS /forest/demandeAjoutModele/count?fields%5BdemandeAjoutModele%5D=id%2Cmarque%2Ccreated_at%2Cmodele%2Cuser%2Ccategorie%2CsousCategorie&fields%5Buser%5D=nomcomplet&fields%5Bcategorie%5D=nom&fields%5BsousCategorie%5D=nom&searchExtended=0&timezone=Europe%2FParis 204 0 - 0.436 ms
[forest] 🌳🌳🌳  Unexpected error: Server does not support secure connnection
{
  "name": "SequelizeConnectionError",
  "parent": {
    "code": "HANDSHAKE_NO_SSL_SUPPORT",
    "fatal": true
  },
  "original": {
    "code": "HANDSHAKE_NO_SSL_SUPPORT",
    "fatal": true
  },
  "stack": "SequelizeConnectionError: Server does not support secure connnection\n    at /home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:19\n    at tryCatcher (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:547:31)\n    at Promise._settlePromise (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:604:18)\n    at Promise._settlePromise0 (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:649:10)\n    at Promise._settlePromises (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:725:18)\n    at _drainQueueStep (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:93:12)\n    at _drainQueue (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:86:9)\n    at Async._drainQueues (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:102:5)\n    at Immediate.Async.drainQueues [as _onImmediate] (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:15:14)\n    at processImmediate (internal/timers.js:464:21)"
}
[forest] 🌳🌳🌳  Unexpected error: Server does not support secure connnection
{
  "name": "SequelizeConnectionError",
  "parent": {
    "code": "HANDSHAKE_NO_SSL_SUPPORT",
    "fatal": true
  },
  "original": {
    "code": "HANDSHAKE_NO_SSL_SUPPORT",
    "fatal": true
  },
  "stack": "SequelizeConnectionError: Server does not support secure connnection\n    at /home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:19\n    at tryCatcher (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:547:31)\n    at Promise._settlePromise (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:604:18)\n    at Promise._settlePromise0 (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:649:10)\n    at Promise._settlePromises (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/promise.js:725:18)\n    at _drainQueueStep (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:93:12)\n    at _drainQueue (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:86:9)\n    at Async._drainQueues (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:102:5)\n    at Immediate.Async.drainQueues [as _onImmediate] (/home/forest-preprod/public_html/ForestAdmin/node_modules/sequelize/node_modules/bluebird/js/release/async.js:15:14)\n    at processImmediate (internal/timers.js:464:21)"
}
GET /forest/demandeAjoutModele/count?fields%5BdemandeAjoutModele%5D=id%2Cmarque%2Ccreated_at%2Cmodele%2Cuser%2Ccategorie%2CsousCategorie&fields%5Buser%5D=nomcomplet&fields%5Bcategorie%5D=nom&fields%5BsousCategorie%5D=nom&searchExtended=0&timezone=Europe%2FParis 500 115 - 274.188 ms
GET /forest/demandeAjoutModele?timezone=Europe%2FParis&fields%5Bcategorie%5D=nom&fields%5BdemandeAjoutModele%5D=id%2Cmarque%2Ccreated_at%2Cmodele%2Cuser%2Ccategorie%2CsousCategorie&fields%5BsousCategorie%5D=nom&fields%5Buser%5D=nomcomplet&page%5Bnumber%5D=1&page%5Bsize%5D=15&searchExtended=0&sort=-id 500 115 - 465.759 ms

Hey @Timothy_Potter

Looks like you are trying to connect to your database using SSL support, where your server does not support secure connection. Remove the SSL option or manually configure the certificates in your new Sequelize() (models/index.js) code should fix this issue.

Let me know :pray:

3 Likes

Yeah @jeffladiray, congrate it’s working thank you very much !

1 Like

Good to know :raised_hands: I’m closing this thread then. Don’t hesitate to open another one if needed :slight_smile:

1 Like