Contents
개요
최근 사용중인 Nextcloud의 업데이트를 미루다가 한 번에 몰아서 하고 나니 아래같은 메세지를 받았습니다.

심지어 문서를 눌렀더니 해당 내용이 아닌 nextcloud wiki메인페이지로 보내버려서 하나하나 찾아봐야 합니다(짜증).
아무튼 해결해봅시다.
문제의 원인
Nextcloud의 config.php파일에 이런 문구가 있습니다.
'upgrade.disable-web' => true,

이게 바로 문제의 ‘브라우저를 통한 업데이트’ 기능을 차단한다는 문구인데,
TrueNAS의 카탈로그를 통해서 설치하면 기본으로 셋팅되어 있습니다.
단순히 지우거나 False로 변경하면 되는 듯 한데, 레딧에서 몇 가지 검색을 해보니 이 기능이 말썽을 일으키는 경우도 있는 것 같더라구요.
그래서 건드리지 않고, 시키는 대로 명령줄로 해결해 보겠습니다.
해결법
TrueNAS에 Nextcloud 설치하는 법을 작성했던 글 내용과 동일하게 root를 획득해 줍니다.
su -m www-data -c 'php $(pwd)/occ upgrade'
그리고 아래 명령어를 실행하면 됩니다.
su -m www-data -c 'php $(pwd)/occ upgrade'
그러면 아래처럼 업그레이드가 진행되고, 이후 Nextcloud에 진입할 수 있게 됩니다.
(TrueNAS에서 이미지 업데이트를 했는데, 왜 또 이런 과정을 밟아야 하는지는 노이해…)
root@nextcloud-78fbdcf66b-fhvmp:/var/www/vhosts/wordpress1# su -m www-data -c 'php $(pwd)/occ upgrade'
Console has to be executed with the user that owns the data directory
Current user id: 33
Owner id of the data directory: 0
Try adding 'sudo -u #0' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes)

root@nextcloud-78fbdcf66b-fhvmp:/var/www/vhosts/wordpress1# su -m root -c 'php $(pwd)/occ upgrade'
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Disabled incompatible app: richdocuments
Updating <federation> ...
Updated <federation> to 1.19.0
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 1.17.0
Updating <oauth2> ...
Updated <oauth2> to 1.17.0
Updating <password_policy> ...
Updated <password_policy> to 1.19.0
Updating <photos> ...
Updated <photos> to 2.5.0
Updating <files> ...
Updated <files> to 2.1.0
Updating <activity> ...
Updated <activity> to 2.21.1
Updating <circles> ...
Updated <circles> to 29.0.0-dev
Updating <cloud_federation_api> ...
Updated <cloud_federation_api> to 1.12.0
Updating <dav> ...
Fix broken values of calendar objects
Done
0/0 [->--------------------------] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [----->----------------------] 0%
Updated <dav> to 1.30.1
Updating <files_external> ...
Updated <files_external> to 1.21.0
Updating <files_sharing> ...
Fix broken values of calendar objects
Done
0/0 [--------->------------------] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [------------->--------------] 0%
Updated <files_sharing> to 1.21.0
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.19.0
Updating <files_versions> ...
Updated <files_versions> to 1.22.0
Updating <sharebymail> ...
Updated <sharebymail> to 1.19.0
Updating <workflowengine> ...
Fix broken values of calendar objects
Done
0/0 [---------------->-----------] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [-------------------->-------] 0%
Updated <workflowengine> to 2.11.0
Updating <comments> ...
Updated <comments> to 1.19.0
Updating <firstrunwizard> ...
Updated <firstrunwizard> to 2.18.0
Updating <logreader> ...
Updated <logreader> to 2.14.0
Updating <nextcloud_announcements> ...
Updated <nextcloud_announcements> to 1.18.0
Updating <notifications> ...
Updated <notifications> to 2.17.0
Updating <systemtags> ...
Updated <systemtags> to 1.19.0
Updating <theming> ...
Fix broken values of calendar objects
Done
0/0 [------------------------>---] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [>---------------------------] 0%
Updated <theming> to 2.4.0
Updating <contactsinteraction> ...
Updated <contactsinteraction> to 1.10.0
Updating <dashboard> ...
Updated <dashboard> to 7.9.0
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.19.0
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 2.10.0
Updating <files_reminders> ...
Updated <files_reminders> to 1.2.0
Updating <privacy> ...
Updated <privacy> to 1.13.0
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.19.0
Updating <recommendations> ...
Updated <recommendations> to 2.1.0
Updating <related_resources> ...
Updated <related_resources> to 1.4.0
Updating <serverinfo> ...
Updated <serverinfo> to 1.19.0
Updating <settings> ...
Updated <settings> to 1.12.0
Updating <support> ...
Fix broken values of calendar objects
Done
0/0 [--->------------------------] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [------->--------------------] 0%
Updated <support> to 1.12.0
Updating <survey_client> ...
Fix broken values of calendar objects
Done
0/0 [----------->----------------] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [-------------->-------------] 0%
Updated <survey_client> to 1.17.0
Updating <text> ...
Fix broken values of calendar objects
Done
0/0 [------------------>---------] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [---------------------->-----] 0%
Updated <text> to 3.10.0
Updating <twofactor_backupcodes> ...
Fix broken values of calendar objects
Done
0/0 [-------------------------->-] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [->--------------------------] 0%
Updated <twofactor_backupcodes> to 1.18.0
Updating <updatenotification> ...
Updated <updatenotification> to 1.19.1
Updating <user_status> ...
Updated <user_status> to 1.9.0
Updating <viewer> ...
Updated <viewer> to 2.3.0
Updating <weather_status> ...
Updated <weather_status> to 1.9.0
Update app richdocuments from App Store
Fix broken values of calendar objects
Done
0/0 [----->----------------------] 0%
Clean up old calendar subscriptions from deleted users that were not cleaned-up
Done
0/0 [--------->------------------] 0%
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level


문제 해결(Trouble Shooting)
‘This account is currently not available’
이 메세지는 ‘su’과정을 거치지 않고 진행하면 발생합니다. 아래처럼요.

꼭 ‘su’를 입력하여 root인 상태에서 진행하셔야 합니다.

‘Console has to be executed with the user that owns the data directory’
만일 이전 제 글과 같이 권한 설정을 하고 설치를 진행하셨다면, nextcloud의 data dataset의 소유자가 www-data가 아니라 root일 겁니다.
일반적인 가이드에서는 소유자가 www-data로 변경되어 있기 때문에,
su -m www-data… 로 명령을 내려 occ를 실행할 수 있지만, 이 경우는 소유자가 root이므로 아래와 같은 오류 메세지를 만나게 됩니다.

그래서 su -m www-data가 아니라 su -m root로 진행하시면 됩니다.
(그래서 위에도 보시면 업그레이드 명령의 인수에 root가 들어가 있었습니다.)
su -m root -c 'php $(pwd)/occ upgrade'
이 내용은 개인 환경에 따라 다르므로 dataset의 소유계정이 무엇이냐에 따라 root 대신 다른 id가 들어갈 수도 있습니다.
관련 글
TrueNAS에 Nextcloud 29버전 업데이트 시 Dataset 재설정하기