Nextcloud on omv 5 instalation-port connectivity issue

  • Hi again!

    Project

    After I succesfuly setup VPN with docke/containers, now I am trying to install the nextcloud. by following the instructions from BD tech blog.


    Issue

    At the last part of instalation, I got an issue with nextcloud-proxy connectivity because there is another application that is using the port 443.

    I checked what is on this port and it is the nginx. I did try to edit the etc/nginx/sites-available/default and changed the ports but no changes. I killed the the process as well which it let me to cary on with the instalation but I could not get acccess to the subdomain and setup the nextcloud.

    My thoughts now is to remove completely the nginx from the omv. I do not know if that is a good idea or not and how it will the affect the system.

    Code
    root@omv:~# sudo netstat -ntulp | grep 443
    tcp6       0      0 :::443                  :::*                    LISTEN      18788/nginx: master
    Code
    sudo lsof -i -P -n | grep LISTEN


    Any suggestions welcome as I can not find any clean solution for this anywhere.

    Thank you!

  • by following the instructions from BD tech blog.

    Please, DO NOT USE DBTech guide. You will have problems.

    If you want to follow any guide for Nextcloud, use the one on this forum that is well supported.

    [How-To] Nextcloud with swag (Letsencrypt) using OMV and docker-compose - Guides - openmediavault



    I checked what is on this port and it is the nginx. I did try to edit the etc/nginx/sites-available/default and changed the ports but no changes. I killed the the process as well which it let me to cary on with the instalation but I could not get acccess to the subdomain and setup the nextcloud.

    And this is why I made the above statement.



    My thoughts now is to remove completely the nginx from the omv.

    If you do that, you will be unable to access OMV.

    OMV Gui is running via Nginx.

  • Please, DO NOT USE DBTech guide. You will have problems.

    If you want to follow any guide for Nextcloud, use the one on this forum that is well supported.

    [How-To] Nextcloud with swag (Letsencrypt) using OMV and docker-compose - Guides - openmediavault

    I realised that as well that there was something wrong with his guide. I was about to try the one from Techdad quide but I will try the one that you are suggesting if I manage to remove what I have done already from DBtech guide and I migh come back for any farther questions as I am a bit new to this!

    Thank you for now!

  • I did what Soma sugested to me and the port forwarding problem resolved and also the instalation was easier.

    But I can not get in the nextcloud website yet. There is an error that I can not understant.


    When i am trying to access https://@@@@@@.duckdns.org/nextcloud/ I got the following message:


    Code
    Internal Server Error
    
    The server encountered an internal error and was unable to complete your request.
    Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
    More details can be found in the webserver log.

    when i type just my domain @@@@@.duckddns.org I got access to the swag welcome screen which means the the swag container is working ok I guess.


    Trying looking arround and I found in the nextcloud container log the bellow error which repeats itself:


    Code
     -1 }">  thrown in /config/www/nextcloud/cron.php on line 165
     -1 }">PHP Fatal error:  Uncaught Error: Call to a member function getLogger() on null in /config/www/nextcloud/cron.php:165
     -1 }">
    Stack trace:

    Do i have to install php?

  • Post the output of (hide sensible data, passwords, etc) :


    cat docker-compose.yml

    docker logs -f swag (Ctrl+C to exit)

    docker logs -f nextcloud (Ctrl+C to exit)

    docker logs -f nextclouddb (Ctrl+C to exit)


    Did you made the initial setup of Nextcloud via internal IP and after, the changes to the config.php as instructed in the guide?


    The error you have is a failed communication between NC and the DB.

  • Thank you for you respond and apologies for my delayed answer to your questions!


    I would like add if that makes any deifference that I choosed to do the alternative way of installation by deploing a stack on the portainer as I have setup the docker and portainer on external usb storage it felt easier amd quicker to do.

    Below I am posting everything that you asked me :


    cat docker-compose.yml



    _swag_logs.txt


    _nextcloud_logs.txt


    _nextclouddb_logs.txt


    And this is the config.php so to have a look if I got anything wrong




    But I did not understand your question about the internal IP. What did you mean?


    Thank you for your time!

  • [EDIT]

    Just spotted your error on the config.php:


    After datadirectory, you ended the script with ); 

    Delete it.


    In the end of the file, below ),  add a next line with );

    Like this:

    Code
      'trusted_domains' => 
      array (
        0 => 'your.url:443',
      ),
    );



    Restart nextcloud and the php error should be gone.

    [/EDIT]




    Did you got to the initial setup page of Nextcloud?
    According to the config.php, you didn't since you don't have the LAN IP on the trusted domains.


    And did you made the step to rename the nexcloud.subfolder.conf.sample to nextcloud.subfolder.conf on the SWAG proxy.confs folder?


    Following the guide, you missed some things:


    1 - Edit your stack/YML to have this ports environments on the Nextcloud service:

    Code
      nextcloud:
      .....
        depends_on:
          - mariadb
        ports: # This is to be added
          - 450:443 # Ditto
        restart: unless-stopped


    2 - Edit your config.php trusted domains to have these lines:

    Code
      'trusted_domains' => 
      array (
        0 => '192.168.x.xx:450', # This will be your LAN IP
        1 => 'your.url:443',
      ),


    Restart SWAG and restart Nextcloud and you can access the initial page of NC on a Browser with:

    https://192.168.x.xx:450 (accept the error with missing certificate) and make the initial configuration of NC.


    If you want, go back to the Guide and re-read the steps, mainly after:

  • I corrected I think anything that you said and I ve been throught the guides again. But I have other issue now, sorry!

    I got on the NC setup site but while was trying to setup I got the folowing message and I can not return to the initial NC setup page.




    The server was unable to complete your request.

    If this happens again, please send the technical details below to the server administrator.

    More details can be found in the server log.

    Technical details

    • Remote Address: 77.99.90.111
    • Request ID: O0iiN4xzsKH5nPSS2rmS

    So my questions are:


    1) Do I have to open manualy the port 450 on the router for my omv?

    2) on the stack script the ports on line 5 which should I put? 80-81 or 444:443

    Code
    nextcloud:
    .....
    depends_on:
    - mariadb
    ports: # ???
    - 450:443 # Ditto
    restart: unless-stopped

    3)when I tried to get with the 192.168.x.xx:450 it did not work at all but only I managed to get to the NC setup with my .duckdns.org/nextcloud and after the setup I got the above message


    4)the nextcloud log now has the following log if that helps

    Code
     Exception: Not installed in /config/www/nextcloud/lib/base.php:277
     
    Stack trace:
     #0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
     #1 /config/www/nextcloud/lib/base.php(1087): OC::init()
     #2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')




    I checked the steps and I believe have followed them. Sorry if I am a pain but I am trying to setup it by the end of the next week and I know my skills are not there for resolving this errors.


    Thank you for you help

  • Ok, let's start from the top:


    How did you launch the stack? Copy pasted on Portainer or via command line with docker-compose up -d inside the folder with the YML?

  • 1) Do I have to open manualy the port 450 on the router for my omv?

    No. The use of port 450 is just on the LAN.


    2) on the stack script the ports on line 5 which should I put? 80-81 or 444:443

    Nothing other than the way I wrote it.


    3)when I tried to get with the 192.168.x.xx:450 it did not work at all but only I managed to get to the NC setup with my .duckdns.org/nextcloud and after the setup I got the above message

    Edit the config.php to this:

    Code
      'trusted_domains' => 
      array (
        0 => 'https://192.168.x.xx:450', # This will be your LAN IP
        1 => 'your.url:443',
      ),

    On the IP above, you need to change the xxxxs to the value of your LAN IP

  • I opened the config .php and it looks differrent now tha previously now with some extra changes. is that normal? I did add my LAN ip as you said in the previous post but now I can not see it except on the line 13 where is my subnomain only

    Code
    0 => 'https://192.168.x.xx:450' #replacing the x.xx of course!!!! :)

    I will add again the LAN IP as you said as long it looks ok to you in the below image.


  • I opened the config .php and it looks differrent now tha previously now with some extra changes. is that normal?

    Yes, everytime you change things in the Nextcloud, config.php will change since it's the file that holds all configuration for it.


    What I see is that the db you selected is pgsql when it should have been mysql




    That is why it's failing to communicate with the DB.

    You need to start fresh, deleting the config folder from Nextcloud so to trigger again the initial install.


    Please, post the stack/YML in a code box here (not a screenshot) only hiding the email, domain and password.

    Don't need to mask the PUID and the path to the folders.


    That way it will be easier to post the proper commands for you to use.

  • I deleted the config folder but I thing the situation messed up!!!

    I will remove everything and start from the beginning again more carefully this time and maybe from the cli!

    A friend warned me that dockers and containers could be complicated but ...I like challenges!

    Soma thank you for your time so far! If i got in trouble again I know where to find you!

  • I deleted the config folder but I thing the situation messed up!!!

    I will remove everything and start from the beginning again more carefully this time and maybe from the cli!

    A friend warned me that dockers and containers could be complicated but ...I like challenges!

    Soma thank you for your time so far! If i got in trouble again I know where to find you!

    Docker can feel complicated until you do it a few times.

    As soon as you understand the "mechanics" behind it, you'll see that it's quite easy to set up and deploy containers.


    Skim down the guides section ( chente as made some nices guides) and see if you get a better hang of it.


    As a personal preference, I only launch containers via CLI/docker-compose although I can still see them on Portainer.

    Main reason is, in case of OS reinstall, all I need is the YMLs (and a backup of the configs/data folders) for the apps I use to set it back up in no time.


    If you need help, just post here and someone will assist you.

  • Thanks Soma!

    One last question before restart my installation again. Because is not clear on the guides and I do not know if that matters,

    when I am on the cli, where do i have to create the docker-compose.yml? On the internal disk where I am running the omv server or on the external storage where I have the docker and containers?

  • Actuall it dosen't matter. Put them where you have your backups set up.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • when I am on the cli, where do i have to create the docker-compose.yml?

    I've gained the habit of creating a folder with the same name as the app I'll be launching on my home:

    For eg.

    mkdir /home/pi/nextcloud and then cd to it.

    All it takes is to nano docker-compose.yml and copy/paste the basic stack that we can find on the github and edit it to fit the need.


    Since I make a backup of the /home folder once in a while, it's always safe-guarded.


    It up to you to find the best method.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!