Unable to install my ACE app deployed on Heroku on my instance (return 401)

hello evryone
after developing and testing my ACE i deployed it on heroku when i call my app url ( https://agil-cockpit.herokuapp.com/) it return the atlassian-connect.json just fine , now i tried to install my app on my instance but i got 401 error , i run the commande heroku logs --tail to show the log so i got this

2021-01-07T12:43:10.086390+00:00 heroku[router]: at=info method=GET path="/atlassian-connect.json" host=agil-cockpit.herokuapp.com request_id=59458544-c960-4d2c-a783-a5bfdba358f8 fwd="52.215.192.230" dyno=web.1 connect=1ms service=1
9ms status=200 bytes=850 protocol=https
2021-01-07T12:43:10.085822+00:00 app[web.1]: ::ffff:10.109.166.130 - - [07/Jan/2021:12:43:10 +0000] "GET /atlassian-connect.json HTTP/1.1" 200 419 "-" "Apache-HttpClient/4.5.13 (Java/1.8.0_275)"
2021-01-07T12:43:10.839056+00:00 heroku[router]: at=info method=POST path="/installed" host=agil-cockpit.herokuapp.com request_id=22cc48b1-a011-42e0-8a7e-fc15f82dc973 fwd="52.215.192.227" dyno=web.1 connect=1ms service=31ms status=4
01 bytes=566 protocol=https
2021-01-07T12:43:10.813006+00:00 app[web.1]: Installation verification error: 401 no pg_hba.conf entry for host "54.210.58.36", user "yjozzozofeciwl", database "d6vhckjkl9l4d2", SSL off
2021-01-07T12:43:10.838809+00:00 app[web.1]: ::ffff:10.111.171.190 - - [07/Jan/2021:12:43:10 +0000] "POST /installed HTTP/1.1" 401 133 "-" "Atlassian HttpClient unknown / JIRA-1001.0.0-SNAPSHOT (100154) / Atlassian-Connect/1001.0.0-
SNAPSHOT"

this is my atlassian-connect.json

{
    "key": "new key ",
    "name": "My app",
    "description": "My very first app",
    "baseUrl": "{{localBaseUrl}}",
    "authentication": {
        "type": "jwt"
    },
    "lifecycle": {
        "installed": "/installed"
    },
    "scopes": [
        "READ","WRITE","ADMIN"
    ],
    "modules": {
        "generalPages": [
            {
                "key": "test ",
                "location": "system.top.navigation.bar",
                "name": {
                    "value": "test"
                },
                "url": "/myplugin",
                "conditions": [{
                    "condition": "user_is_logged_in"
                }]
            }


        ]
    }
}

any help please

Hi @hamzabouallegue,

It looks like there is a problem accessing your PostgreSQL db during installation, that’s the error message in the second to last line in your log excerpt.
Can you share a bit more about your database setup? I’m guessing you are not using Heroku’s PostgreSQL, right?

Regards,
Oliver

@osiebenmarck thank you for your response
i used this commande heroku addons:add heroku-postgresql:hobby-dev --app <add-on-name> in may case heroku addons:add heroku-postgresql:hobby-dev --app agil-cockpit
from my config.json :

 "production": {
       
        "port": "$PORT",
    
        "errorTemplate": true,
       
        "localBaseUrl": "https://agil-cockpit.herokuapp.com/",
        "store": {
           
            "type": "postgres",
      
            "url": "$DATABASE_URL"
        },
   
        "whitelist": [
            "*.jira-dev.com",
            "*.atlassian.net",
            "*.atlassian.com",
            "*.jira.com"
        ]
    }

what is missing please !

Hi @hamzabouallegue,

can you try the following in your config.json:

    "store": {
      "adapter": "sequelize",
      "type": "postgres",
      "logging": false,
      "url": "$DATABASE_URL",
      "ssl": true
    },

My hunch is, that your app does not use SSL to connect to the DB, which would be rejected by Heroku’s PostgreSQL.

Hope that helps,
Oliver

same error (401) unfortunately
2021-01-07T14:09:49.516751+00:00 app[web.1]: Installation verification error: 401 no pg_hba.conf entry for host "3.84.248.46", user "yjozzozofeciwl", database "d6vhckjkl9l4d2", SSL off
my config.json :

"production": {
     
        "port": "$PORT",

        "errorTemplate": true,
      
        "localBaseUrl": "https://agil-cockpit.herokuapp.com/",
        "store": {
          
            "adapter": "sequelize",
            "type": "postgres",
            "logging": false,
            "url": "$DATABASE_URL",
            "ssl": true

        },
    
        "whitelist": [
            "*.jira-dev.com",
            "*.atlassian.net",
            "*.atlassian.com",
            "*.jira.com"
        ]
    },

i fix that by downgraded pg version from 8 to 7 now i m able to install may ACE app in my instance
but i m facing this error while runing my app
Error: Could not load the component dashboard.jsx. Did you run npm buildto compile your jsx files?

this is my route file :
export default function routes(app, addon) {

app.get('/', (req, res) => {
    res.redirect('/atlassian-connect.json');
});


app.get('/cockpit',  addon.authenticate(), (req, res) => {

    res.render(
      'dashboard.jsx',
      {
        title: 'Atlassian Connect'
       
      }
    );

});

}
i tried to change my dashboard.jsx with another file test.hbs it works perfectly .

when i run my app localy using ngrok it works fine as expected with my jsx