YunoHost-Apps / mastodon_ynh

Free, open-source social network for YunoHost
https://joinmastodon.org/
GNU Affero General Public License v3.0
84 stars 33 forks source link

installation fails because it can't swapon from inside a LXC #355

Closed rosbeef closed 8 months ago

rosbeef commented 1 year ago

Describe the bug

can not install due to lake of memory inside a container. corrected in #354

Context

Steps to reproduce

Expected behavior

install without creating swap, as lxc have no swap permission.

Logs

swap creation fail

yalh76 commented 1 year ago

can you provide the yunopaste of the install logs ?

rosbeef commented 1 year ago

I'm inside a container lxc Disabeling swap creation, when in-container detection is positive (see pr #354 ) it works. More, install not consume more than 1,5g

` 2022-12-06 18:57:48,187: DEBUG - ++ lsblk --output PKNAME --noheadings /dev/sda1 2022-12-06 18:57:48,233: WARNING - lsblk: /dev/sda1: not a block device 2022-12-06 18:57:48,236: DEBUG - + local main_device= 2022-12-06 18:57:48,237: DEBUG - + echo 2022-12-06 18:57:48,238: DEBUG - + grep --quiet mmc 2022-12-06 18:57:48,301: DEBUG - + return 1 2022-12-06 18:57:48,303: DEBUG - + '[' 148896148 -ge 583680 ']' 2022-12-06 18:57:48,304: DEBUG - + local swap_size=583680 2022-12-06 18:57:48,305: DEBUG - + '[' 583680 -ne 0 ']' 2022-12-06 18:57:48,306: DEBUG - + '[' '!' -e /swap_mastodon ']' 2022-12-06 18:57:48,308: DEBUG - + fallocate -l 583680K /swap_mastodon 2022-12-06 18:57:53,210: DEBUG - + chmod 0600 /swap_mastodon 2022-12-06 18:57:53,220: DEBUG - + mkswap /swap_mastodon 2022-12-06 18:57:53,318: DEBUG - Setting up swapspace version 1, size = 570 MiB (597684224 bytes) 2022-12-06 18:57:53,319: DEBUG - no label, UUID=916ffaa2-8e26-42ca-9a0d-77b91da22b78 2022-12-06 18:57:53,321: DEBUG - + swapon /swap_mastodon 2022-12-06 18:57:53,333: WARNING - swapon: /swap_mastodon: swapon failed: Operation not permitted 2022-12-06 18:57:53,336: DEBUG - + ynh_exit_properly 2022-12-06 18:57:53,336: DEBUG - + local exit_code=255 2022-12-06 18:57:53,337: DEBUG - + rm -rf /var/cache/yunohost/download/ 2022-12-06 18:57:53,354: DEBUG - + '[' 255 -eq 0 ']' 2022-12-06 18:57:53,355: DEBUG - + trap '' EXIT 2022-12-06 18:57:53,355: DEBUG - + set +o errexit 2022-12-06 18:57:53,356: DEBUG - + set +o nounset 2022-12-06 18:57:53,356: DEBUG - + sleep 0.5 2022-12-06 18:57:53,892: DEBUG - + type -t ynh_clean_setup 2022-12-06 18:57:53,896: DEBUG - + ynh_clean_setup 2022-12-06 18:57:53,897: DEBUG - + true 2022-12-06 18:57:53,897: DEBUG - + exit 1 2022-12-06 18:57:54,940: ERROR - Unable to install mastodon: An error occurred inside the app installation script

josh85glenn commented 11 months ago

Hi @rosbeef

Can I ask are you setting up on a device that has 4gb of RAM or more? NB: I'm just trying to help but I believe system requirements are 4GB of RAM for Mastodon. I use a rpi 4gb variant and Mastodon runs fine using Yunohost.

rosbeef commented 11 months ago

Hi @josh85glenn

I have 2G physical ram Mastodon never used more than 1,5G and only during install process.

My problem is that I'm inside an lxc container and swap creation during install is not supported inside container. So I manualy modify the install script to skip the swap creation testing if i'm inside a container. and it works.

But each new updates erase my modification.

I've made a PR to take this in account but it were not accepted. Maybe mastodon recomend 4g but with my 5 user instance with my x services like matrix, nextcloud... And mastodon I had never had problems with my 2 gigs.