New AWS EC2 Install - Can't write to database (UI won't save settings or posting new topics)



  • Hello, everyone.

    I am getting "Looks like your connection to NodeBB was lost, please wait while we try to reconnect." and more importantly, I can't edit anything settings with the UI or create posts, as if write permissions are being denied?


    I have experience installing and running PHP/MySQL scripts through FTP, but this is my first attempt at installing a Node.js application on Ubuntu from afar.

    I have a free server from AWS EC2: Ubuntu Server 18.04 LTS running.

    I followed guides and installed everything and even tried to get NiginX working for a domain name.

    Again, I am new with running Ubuntu commands through PuTTy, but any help or guidance would be appreciated.


  • Global Moderator

    Is there url value in config.json exactly equal to the url at which you are accessing your site?



  • @PitaJ said in New AWS EC2 Install - Can't write to database (UI won't save settings or posting new topics):

    Is there url value in config.json exactly equal to the url at which you are accessing your site?

    Yes. The URL value is set to my ip address like the following:

        "url": "http://XX.XXX.XX.XX",
        "secret": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "database": "mongo",
        "mongo": {
            "host": "127.0.0.1",
            "port": "27017",
            "username": "nodebb",
            "password": "xxxxxxxxxx",
            "database": "nodebb",
            "uri": ""
        },
        "port": "4567"
    }
    

    Problem 1: I had nginx configured incorrectly. This was obvious because my ip address (with no port) would load the nginx screen. I was still forced to add :4567 to the end of the IP.

    Error when trying to restart nginx with:
    sudo systemctl restart nginx.service

    Used this to check the log:
    sudo journalctl -xel

    Determined that the file "forum.example.com" was still in the "sites-enabled" directory and therefore was trying to also be run alongside my domain config file. After deleting the example file and restarting, I was then able to access nodebb from the ip without the port.

    Problem 2:
    Still getting "connection to NodeBB was lost, please wait while we try to reconnect."

    Problem 3.
    Still can't add content or adjust settings.

    Problem 4.
    Having trouble assigning a google domain name to the AWS IP address. I'm used to just using name hosts from a web server, but it seems I have to utilize "custom resource records" and simply input the IP address?



  • Everything is working now after fixing Problem 4 and configuring from IP to domain name.

    I was attempting to get nodebb working on strictly the IP address. However, I was able to get the domain linked by utilizing Custome Resource Records settings of:

    Name / Type / TTL / DATA
    @ / A / 1h / xx.xxx.xx.xx
    * / A / 1h / xx.xxx.xx.xx
    

    Then, I simply changed my ip address to the domain and now everything is working perfectly. I am not sure why, though.


 

| |