Resource icon

Scripted installation of Nextcloud 28 in iocage jail 2018-03-23

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I haven't tested it a lot with CORE 13, but AFAIK it works fine there.
I can tell you a jail created on 12, then upgraded to 13 is fine, but haven't tried it with the install on 13 directly.

I suspect the matching of the host OS version to the RELEASE is what went wrong above.
 

xames

Patron
Joined
Jun 1, 2020
Messages
235
How i can use another port than 80 and 443 externally, maybe 8000 and 44300, and translate then to 80 and 443 for example? how i can implement that, or it's not possible?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
How i can use another port than 80 and 443 externally, maybe 8000 and 44300, and translate then to 80 and 443 for example? how i can implement that, or it's not possible?
Either with NAT (port forwarding) on your Firewall/router or using a reverse proxy.
 

xames

Patron
Joined
Jun 1, 2020
Messages
235
I cannot do NAT because i'm in double nat, the isp behind my firewall has the ports 80 and 443 not disponible, anyone knows if its posible to do that type of thinks in cloudflare? Because i don't know how to do a reverse proxy easy, is that a new jail on truenas?
 

bermau

Dabbler
Joined
Jul 4, 2017
Messages
28
Hello to everybody,
I don't know if anyone already showed the version update problem.
Whenever nextcloud needs to be updated, at the end I get the following error:
Internal ServerError
(see screenshot).
I don't know how to fix, only way is reinstall via script.
does this happen to anyone else too?

Thanks in advance.
MB
 

Attachments

  • Immagine 2023-01-19 124846.jpg
    Immagine 2023-01-19 124846.jpg
    180.5 KB · Views: 103

victort

Guru
Joined
Dec 31, 2021
Messages
973
How i can use another port than 80 and 443 externally, maybe 8000 and 44300, and translate then to 80 and 443 for example? how i can implement that, or it's not possible?
You could use cloudflared tunnel.


If you used caddy self signed, stand-alone, or dns cert, you will need to set the Origin Server Name and HTTP Host Header to whatever domain you are proxying to.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hello to everybody,
I don't know if anyone already showed the version update problem.
Whenever nextcloud needs to be updated, at the end I get the following error:
Internal ServerError
(see screenshot).
I don't know how to fix, only way is reinstall via script.
does this happen to anyone else too?

Thanks in advance.
MB
We would need to see the log. This would be in
/var/log/caddy/caddy.log
 

xames

Patron
Joined
Jun 1, 2020
Messages
235
The api token must include all zones, or only one specific, because i have more than 1 domain there
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
The api token must include all zones, or only one specific, because i have more than 1 domain there
It should only include the one you plan to use with caddy.
 

bermau

Dabbler
Joined
Jul 4, 2017
Messages
28
We would need to see the log. This would be in
/var/log/caddy/caddy.log
Hi Victort,
I attach the log as indicated.
I specify that my jail is exposed on the internet through Caddy Reverse Proxy jail (Danb35 guide).
Reverse Proxy jail IP: 10.10.0.50
nextcloud jail IP: 10.10.0.55

thanks for your help.
MB
 

Attachments

  • nextcloud-caddy-2023-01-19.txt
    30 KB · Views: 91

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hi Victort,
I attach the log as indicated.
I specify that my jail is exposed on the internet through Caddy Reverse Proxy jail (Danb35 guide).
Reverse Proxy jail IP: 10.10.0.50
nextcloud jail IP: 10.10.0.55

thanks for your help.
MB
Ok. The log looks ok.
The reverse proxy part of this setup might be causing the issue. I have never run it that way.

When Nextcloud updates, I suspect it does something to the config that the reverse proxy doesn’t reflect. Not 100% sure what that could be though…
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hi Victort,
I attach the log as indicated.
I specify that my jail is exposed on the internet through Caddy Reverse Proxy jail (Danb35 guide).
Reverse Proxy jail IP: 10.10.0.50
nextcloud jail IP: 10.10.0.55

thanks for your help.
MB
Can you share your Caddyfile for both the reverse proxy and the nextcloud?

I just set everything up like you described and was able to update without issue.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
@danb35
I just did a reinstall, and am getting a 500 error also.

Code:
Reinstall detected, skipping generation of new config and database
RedisException: Permission denied in /usr/local/www/nextcloud/lib/private/RedisFactory.php:137
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/RedisFactory.php(137): Redis->pconnect('/var/run/redis/...', 0, 0, NULL, 0, 0)
#1 /usr/local/www/nextcloud/lib/private/RedisFactory.php(178): OC\RedisFactory->create()
#2 /usr/local/www/nextcloud/lib/private/Memcache/Redis.php(43): OC\RedisFactory->getInstance()
#3 /usr/local/www/nextcloud/lib/private/Memcache/Factory.php(118): OC\Memcache\Redis->__construct('9fe6d94550f4813...')
#4 /usr/local/www/nextcloud/lib/private/Server.php(1120): OC\Memcache\Factory->createLocking('lock')
#5 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#6 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#7 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#8 /usr/local/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#9 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#10 /usr/local/www/nextcloud/lib/private/Server.php(2070): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#11 /usr/local/www/nextcloud/lib/private/Files/View.php(117): OC\Server->getLockingProvider()
#12 /usr/local/www/nextcloud/lib/private/Server.php(462): OC\Files\View->__construct()
#13 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#14 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#15 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#16 /usr/local/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#17 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#18 /usr/local/www/nextcloud/lib/private/Server.php(1472): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#19 /usr/local/www/nextcloud/lib/base.php(617): OC\Server->boot()
#20 /usr/local/www/nextcloud/lib/base.php(1144): OC::init()
#21 /usr/local/www/nextcloud/cron.php(43): require_once('/usr/local/www/...')
#22 {main}
Command: su -m www -c php -f /usr/local/www/nextcloud/cron.php failed!


Is this normal?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
@danb35
I just did a reinstall, and am getting a 500 error also.

Code:
Reinstall detected, skipping generation of new config and database
RedisException: Permission denied in /usr/local/www/nextcloud/lib/private/RedisFactory.php:137
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/RedisFactory.php(137): Redis->pconnect('/var/run/redis/...', 0, 0, NULL, 0, 0)
#1 /usr/local/www/nextcloud/lib/private/RedisFactory.php(178): OC\RedisFactory->create()
#2 /usr/local/www/nextcloud/lib/private/Memcache/Redis.php(43): OC\RedisFactory->getInstance()
#3 /usr/local/www/nextcloud/lib/private/Memcache/Factory.php(118): OC\Memcache\Redis->__construct('9fe6d94550f4813...')
#4 /usr/local/www/nextcloud/lib/private/Server.php(1120): OC\Memcache\Factory->createLocking('lock')
#5 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#6 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#7 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#8 /usr/local/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#9 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#10 /usr/local/www/nextcloud/lib/private/Server.php(2070): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#11 /usr/local/www/nextcloud/lib/private/Files/View.php(117): OC\Server->getLockingProvider()
#12 /usr/local/www/nextcloud/lib/private/Server.php(462): OC\Files\View->__construct()
#13 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC\{closure}(Object(OC\Server))
#14 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
#15 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#16 /usr/local/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#17 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#18 /usr/local/www/nextcloud/lib/private/Server.php(1472): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#19 /usr/local/www/nextcloud/lib/base.php(617): OC\Server->boot()
#20 /usr/local/www/nextcloud/lib/base.php(1144): OC::init()
#21 /usr/local/www/nextcloud/cron.php(43): require_once('/usr/local/www/...')
#22 {main}
Command: su -m www -c php -f /usr/local/www/nextcloud/cron.php failed!


Is this normal?
So after going through the script there seems to be a bug. On lines 482-484 there are 2 commands concerning redis that should actually be run even when doing a reinstall, but they are bypassed if it is a reinstall.

On my resinstalled jail I ran both of them, restarted the jail, and now it’s up and running again.

Code:
# Add the www user to the redis group to allow it to access the socket
iocage exec "${JAIL_NAME}" pw usermod www -G redis
iocage exec "${JAIL_NAME}" chmod 777 /var/run/redis/redis.sock


@bermau
Can you try running these two commands from inside your jail after a reinstall?
Code:
pw usermod www -G redis
chmod 777 /var/run/redis/redis.sock


EDIT: I added those two commands to the script right before it detects a reinstall, and ran the install again. It worked fine, and no errors, so I created a pull request on github.
 
Last edited:

xames

Patron
Joined
Jun 1, 2020
Messages
235
I have a clean installation, all works fine, no errors, but now i want to acces to admin and password and says incorrect, my password is the initial one from the shell of nextcloud_db_etc...

I check the caddy log and it seems all fine too.

I go to check nextcloud.log and is the same password, same hour of installation all good, but not enter.

Maybe the first initial gui setup need the ports open?
Because i install nextcloud and now my ports 80 and 443 are not open anymore. I work with that scenario 2 years and fine, i only work in the office and maybe with vpn, but not from outside, but i don't remember if the initial admin gui need this ports for anything.
 

bermau

Dabbler
Joined
Jul 4, 2017
Messages
28
Can you share your Caddyfile for both the reverse proxy and the nextcloud?

I just set everything up like you described and was able to update without issue.
hi,
sorry for the delay.
here is the caddyfile of the jail caddy (ip 10.10.0.50)

{
email myemail@email.com
}
nextcloud.mydomain.com {
encode gzip
reverse_proxy http://10.10.0.55
header {
enable HSTS
Strict-Transport-Security max-age=31536000;
}
redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301
}

I can't find any caddyfile in the nextcloud jail.
maybe you meant the config.php?
/usr/local/www/nextcloud/config/config.php
 
Top