Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Upgrade 23.0.3 to 23.0.4 docker Server does not migrate #1742

Closed
5 of 8 tasks
Y0ngg4n opened this issue May 1, 2022 · 59 comments · Fixed by #1760
Closed
5 of 8 tasks

[Bug]: Upgrade 23.0.3 to 23.0.4 docker Server does not migrate #1742

Y0ngg4n opened this issue May 1, 2022 · 59 comments · Fixed by #1760

Comments

@Y0ngg4n
Copy link

Y0ngg4n commented May 1, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

If i want to update my docker Nextcloud installation i get the following issue, that it is waiting forever. But there is no other process running nextcloud.

Configuring Redis as session handler
Initializing nextcloud 23.0.4.1 ...
Upgrading nextcloud from 23.0.3.2 ...
Another process is initializing Nextcloud. Waiting 10 seconds...
Another process is initializing Nextcloud. Waiting 20 seconds...
Another process is initializing Nextcloud. Waiting 30 seconds...
Another process is initializing Nextcloud. Waiting 40 seconds...
Another process is initializing Nextcloud. Waiting 50 seconds...
Another process is initializing Nextcloud. Waiting 60 seconds...
Another process is initializing Nextcloud. Waiting 70 seconds...
Another process is initializing Nextcloud. Waiting 80 seconds...

Steps to reproduce

  1. Upgrade docker install from 23.0.3.2 to 23.0.4

Expected behavior

Just upgrade it

Installation method

Official Docker image

Operating system

Debian/Ubuntu

PHP engine version

No response

Web server

No response

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

accessibility  cloud_federation_api  dav                   files             files_sharing      firstrunwizard           notifications    privacy           settings       systemtags             updatenotification  weather_status
activity       comments              encryption            files_external    files_trashbin     logreader                oauth2           provisioning_api  sharebymail    text                   user_ldap           workflowengine
admin_audit    contactsinteraction   federatedfilesharing  files_pdfviewer   files_versions     lookup_server_connector  password_policy  recommendations   support        theming                user_status
circles        dashboard             federation            files_rightclick  files_videoplayer  nextcloud_announcements  photos           serverinfo        survey_client  twofactor_backupcodes  viewer

Nextcloud Signing status

No response

Nextcloud Logs

Log is empty

Additional info

No response

@szaimen szaimen transferred this issue from nextcloud/server May 1, 2022
@Mape6
Copy link

Mape6 commented May 3, 2022

I have the exact the same problem. Updated from 23.0.3 to 23.0.4 with same log entries.
I reverted to old image and nextcloud is running again.

@Y0ngg4n
Copy link
Author

Y0ngg4n commented May 3, 2022

I did the same. I will stick with the older version until this Bug gets fixed.

@skjnldsv
Copy link
Member

skjnldsv commented May 4, 2022

Thanks for reporting. Let's investigate

@skjnldsv
Copy link
Member

skjnldsv commented May 4, 2022

Can anyone here share their setup? How many containers are you running? Are you sharing the html volume between those?
What are you using to run docker? An orchestrator? Pure command line? Compose? Swarm?

@Mape6
Copy link

Mape6 commented May 4, 2022

I have docker running on a raspberry pi and manage my containers via docker compose.
I have only one postgres and one nextcloud and one redis container running.

here is my docker compose file content:

volumes:
  data:
  db:

networks:
  frontend:
    name: nc_frontend
  backend:
    name: nc_backend
  reverse-proxy:
    external: true

services:
  postgres:
    container_name: nc_postgres
    image: postgres
    hostname: nc_postgres
    restart: unless-stopped
    command: --transaction-isolation="read committed"
    volumes:
      - db:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=nextcloud
      - POSTGRES_USER=nextcloud
      - POSTGRES_PASSWORD=xxx
    networks:
      backend:

  redis:
    container_name: nc_redis
    image: redis
    restart: unless-stopped
    networks:
      backend:

  nextcloud:
    container_name: nextcloud
    image: nextcloud
    depends_on:
      - postgres
      - redis
    restart: unless-stopped
    expose:
      - 80
    volumes:
      - data:/var/www/html
    environment:
      POSTGRES_HOST: nc_postgres
      POSTGRES_DB: nextcloud
      POSTGRES_USER: nextcloud
      POSTGRES_PASSWORD: xxx
      NEXTCLOUD_TRUSTED_DOMAINS: xxx
      NEXTCLOUD_TRUSTED_PROXIES: 172.29.0.0/16
      DEFAULT_LANGUAGE: de
      DEFAULT_LOCALE: de
      REDIS_HOST: redis
      MEMCACHE.LOCAL: \OC\Memcache\Redis
      MEMCACHE.LOCKING: \OC\Memcache\Redis
    networks:
      frontend:
      backend:
      reverse-proxy:
    labels:
      - traefik.enable=true
      - traefik.docker.network=reverse-proxy
      # http
      - traefik.http.routers.nextcloud.rule=Host(`xxx`)
      - traefik.http.routers.nextcloud.entrypoints=web
      - traefik.http.routers.nextcloud.middlewares=nextcloud-https-redirect,hsts-header
      # https
      - traefik.http.routers.nextcloud-https.rule=Host(`xxx`)
      - traefik.http.routers.nextcloud-https.entrypoints=websecure
      - traefik.http.routers.nextcloud-https.tls=true
      - traefik.http.routers.nextcloud-https.tls.certresolver=myresolver
      - traefik.http.routers.nextcloud-https.tls.options=default2@file
      - traefik.http.routers.nextcloud-https.middlewares=hsts-header
      # https redirect
      - traefik.http.middlewares.nextcloud-https-redirect.redirectscheme.scheme=https
      - traefik.http.middlewares.nextcloud-https-redirect.redirectscheme.permanent=true
      # hsts
      - traefik.http.middlewares.hsts-header.headers.stsSeconds=31536000
      - traefik.http.middlewares.hsts-header.headers.stsIncludeSubdomains=true
      - traefik.http.middlewares.hsts-header.headers.stsPreload=true
      - traefik.http.middlewares.hsts-header.headers.forceSTSHeader=true
      
      - flame.type=application
      - flame.name=Nextcloud
      - flame.url=https://xxx
      - flame.icon=nextcloud

@wivaku
Copy link

wivaku commented May 4, 2022

docker-compose.yaml

version: '2'

services:
  db:
    image: mariadb
    container_name: nextcloud-db
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    build: .
    # image: nextcloud
    container_name: nextcloud
    restart: unless-stopped
    ports:
      - 1100:80
    links:
      - db
    volumes:
      - ./web:/var/www/html
      - ./data:/var/www/data
    environment:
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
      # ---
      - NEXTCLOUD_DATA_DIR=/var/www/data
      - NEXTCLOUD_TRUSTED_DOMAINS=${NEXTCLOUD_TRUSTED_DOMAINS}
      #- TRUSTED_PROXIES=${TRUSTED_PROXIES}
      - OVERWRITEHOST=${OVERWRITEHOST}
      - OVERWRITEPROTOCOL=https
      # ---
      - SMTP_HOST=${SMTP_HOST}
      - SMTP_SECURE=${SMTP_SECURE}
      - SMTP_PORT=${SMTP_PORT}
      - SMTP_NAME=${SMTP_NAME}
      - SMTP_PASSWORD=${SMTP_PASSWORD}
      - MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS}

Dockerfile

FROM nextcloud:apache

RUN apt-get update && apt-get install -y \
	supervisor \
	procps smbclient \
	imagemagick \
	ocrmypdf \
	tesseract-ocr \
	tesseract-ocr-eng \ 
	&& apt-get clean \
	&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
	&& mkdir /var/log/supervisord /var/run/supervisord

COPY build/supervisord.conf /

ENV NEXTCLOUD_UPDATE=1

CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]

@scrummie02
Copy link

same here, upgrade breaks on 23. Can't specify a lower version in the 23 branch, my installation is completely down.

@fdalvi
Copy link

fdalvi commented May 4, 2022

same here, upgrade breaks on 23. Can't specify a lower version in the 23 branch, my installation is completely down.

@scrummie02 Hope this helps: Locally, docker image nextcloud:23.0.3 is available to pull and works fine while latest does not

@scrummie02
Copy link

nextcloud:23.0.3

 [core:crit] [pid 1] (13)Permission denied: AH00078: alloc_listener: failed to get a socket for (null)
AH00526: Syntax error on line 5 of /etc/apache2/ports.conf:
Listen setup failed

I'm getting this now.

@scrummie02
Copy link

Can't even get into the docker container at all now, says it's not started even though it shows up. What a disaster

@jokay
Copy link

jokay commented May 5, 2022

I can confirm this problem for the update to 24.0.0.12 as well.

Configuring Redis as session handler
Initializing nextcloud 24.0.0.12 ...
Upgrading nextcloud from 23.0.3.2 ...
Another process is initializing Nextcloud. Waiting 10 seconds...
Another process is initializing Nextcloud. Waiting 20 seconds...
Another process is initializing Nextcloud. Waiting 30 seconds...
Another process is initializing Nextcloud. Waiting 40 seconds...
Another process is initializing Nextcloud. Waiting 50 seconds...
Another process is initializing Nextcloud. Waiting 60 seconds...

image

@skjnldsv
Copy link
Member

skjnldsv commented May 5, 2022

Can anyone try to manually remove the lock file in your html directory and try again?
/var/www/html/nextcloud-init-sync.lock

I have no idea why this file would be created and not deleted after initialization.
Maybe something got wrong in your compose start process and you killed it?

One this file is deleted, the process will start again ending the Another process is initializing Nextcloud. Waiting xxx seconds... loop

@jokay
Copy link

jokay commented May 5, 2022

@skjnldsv thx, this did work 👍🏼

Configuring Redis as session handler
Initializing nextcloud 24.0.0.12 ...
Upgrading nextcloud from 23.0.3.2 ...
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: twofactor_totp
Updating <lookup_server_connector> ...
Updated <lookup_server_connector> to 1.12.0
Updating <oauth2> ...
Updated <oauth2> to 1.12.0
Updating <files> ...
Updated <files> to 1.19.0
Updating <cloud_federation_api> ...
Updated <cloud_federation_api> to 1.7.0
Updating <dav> ...
Fix broken values of calendar objects

 Starting ...

Clean up old calendar subscriptions from deleted users that were not cleaned-up

    0/0 [>---------------------------]   0% Starting ...

Updated <dav> to 1.22.0
Updating <workflowengine> ...
Updated <workflowengine> to 2.6.0
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.14.0
Updating <provisioning_api> ...
Updated <provisioning_api> to 1.14.0
Updating <settings> ...
Updated <settings> to 1.6.0
Updating <twofactor_backupcodes> ...
Updated <twofactor_backupcodes> to 1.13.0
Updating <viewer> ...
Updated <viewer> to 1.8.0
Update app twofactor_totp from App Store
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level
The following apps have been disabled:
Initializing finished

@skjnldsv
Copy link
Member

skjnldsv commented May 5, 2022

So, this is the issue with a lockfile, I don't think we can really detect if it has been created by accident or if the process that was using it, is actually still running? Anyone have ideas?
I would like to understand why it actually got created for any of you, but not deleted. Aside from killing the process, I cannot see why 🤔

@scrummie02
Copy link

Can anyone try to manually remove the lock file in your html directory and try again? /var/www/html/nextcloud-init-sync.lock

I have no idea why this file would be created and not deleted after initialization. Maybe something got wrong in your compose start process and you killed it?

One this file is deleted, the process will start again ending the Another process is initializing Nextcloud. Waiting xxx seconds... loop

I'll try

@scrummie02
Copy link

So, this is the issue with a lockfile, I don't think we can really detect if it has been created by accident or if the process that was using it, is actually still running? Anyone have ideas? I would like to understand why it actually got created for any of you, but not deleted. Aside from killing the process, I cannot see why 🤔

didn't work for me...it comes back.

@skjnldsv
Copy link
Member

skjnldsv commented May 5, 2022

So, this is the issue with a lockfile, I don't think we can really detect if it has been created by accident or if the process that was using it, is actually still running? Anyone have ideas? I would like to understand why it actually got created for any of you, but not deleted. Aside from killing the process, I cannot see why thinking

didn't work for me...it comes back.

I comes back if you have another container starting with the same shared html

@scrummie02
Copy link

Initializing nextcloud 23.0.4.1 ... Upgrading nextcloud from 23.0.3.2 ... su: System error rsync: [sender] pipe: Permission denied (13) rsync error: error in IPC code (code 14) at pipe.c(121) [sender=3.2.3] Configuring Redis as session handler Initializing nextcloud 23.0.4.1 ... Upgrading nextcloud from 23.0.3.2 ... su: System error Another process is initializing Nextcloud. Waiting 10 seconds...

@scrummie02
Copy link

scrummie02 commented May 5, 2022

So, this is the issue with a lockfile, I don't think we can really detect if it has been created by accident or if the process that was using it, is actually still running? Anyone have ideas? I would like to understand why it actually got created for any of you, but not deleted. Aside from killing the process, I cannot see why thinking

didn't work for me...it comes back.

I comes back if you have another container starting with the same shared html

Thanks for replying...Here is my compose:

version: '3.3'

networks:
 nextcloud:

services:
  nextcloud:
    image: nextcloud:latest
    container_name: nextcloud-app
    #labels:
     # - "com.centurylinklabs.watchtower.enable=true"
    networks:
      - nextcloud
    ports:
      - "8080:80"
    volumes:
      - /data/Docker/nextcloud/html:/var/www/html
      - /data/Docker/nextcloud/data:/srv/nextcloud/data
    depends_on:
      - mariadb
      - redis
      - av
    environment:
      - NEXTCLOUD_TRUSTED_DOMAINS='${NEXTCLOUD_FQDN}'
      - NEXTCLOUD_DATA_DIR=/srv/nextcloud/data
      - MYSQL_DATABASE=xxx
      - MYSQL_USER=xxxx
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_HOST=nextcloud-mariadb
      - REDIS_HOST=nextcloud-redis
    restart: unless-stopped

  mariadb:
    image: mariadb:10.5
    container_name: nextcloud-mariadb
    restart: unless-stopped
    volumes:
      - /data/Docker/nextcloud/mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=xxxx
      - MYSQL_USER=xxxx
    networks:
      - nextcloud

  redis:
    image: redis:6.2-alpine
    container_name: nextcloud-redis
    networks:
      - nextcloud
    restart: unless-stopped
      
  av:
    #debian: image: mkodockx/docker-clamav
    image: mkodockx/docker-clamav:alpine
    container_name: nextcloud-av
    restart: unless-stopped
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
    networks:
      - nextcloud
    ports:
      - "3310:3310"
    volumes:
      - clamav:/var/lib/clamav

What do you mean shared HTML?

@skjnldsv
Copy link
Member

skjnldsv commented May 5, 2022

What do you mean shared HTML?

/data/Docker/nextcloud/html:

  1. stop the nextcloud app service
  2. delete the file
  3. and run the nextcloud app service up again.

It will be created, but it is fine. What is not fine is if the file already exists before the container starts

@wivaku
Copy link

wivaku commented May 5, 2022

Removing the lock file worked, thanks @skjnldsv!

@scrummie02
Copy link

What do you mean shared HTML?

/data/Docker/nextcloud/html:

  1. stop the nextcloud app service
  2. delete the file
  3. and run the nextcloud app service up again.

It will be created, but it is fine. What is not fine is if the file already exists before the container starts

it's a host directory so remove all the contents?

@scrummie02
Copy link

scrummie02 commented May 5, 2022

okay stopped the container and deleted the lockfile; restarted it.

Then this:

Initializing nextcloud 23.0.4.1 ...
Upgrading nextcloud from 23.0.3.2 ...
su: System error
Another process is initializing Nextcloud. Waiting 10 seconds...

This too when lock is deleted
rsync: [sender] pipe: Permission denied (13) rsync error: error in IPC code (code 14) at pipe.c(121) [sender=3.2.3] Configuring Redis as session handler Initializing nextcloud 23.0.4.1 ... Upgrading nextcloud from 23.0.3.2 ... su: System error Another process is initializing Nextcloud. Waiting 10 seconds...

Apache logs:
Starting Apache httpd web server: apache2 failed! The apache2 configtest failed. ... (warning). Output of config test was: [Thu May 05 13:32:57.280837 2022] [core:crit] [pid 88] (13)Permission denied: AH00078: alloc_listener: failed to get a socket for (null) AH00526: Syntax error on line 5 of /etc/apache2/ports.conf: Listen setup failed Action 'configtest' failed. The Apache error log may have more information.

@skjnldsv
Copy link
Member

skjnldsv commented May 5, 2022

Seems like you are facing another unrelated issue 🤔

@scrummie02
Copy link

Seems like you are facing another unrelated issue 🤔

When I do delete it, it comes back and the same error.

@florentls
Copy link

I did get the same, upgrade from 22.2.7 to 23.0.4 and I get the issue.
Downgrade to 23.0.3 fix the issue.

@Mape6
Copy link

Mape6 commented May 8, 2022

I removed the lock file and recreated the container with image of 23.0.4 and got the following log output:

Configuring Redis as session handler
Upgrading nextcloud from 23.0.3.2 ...
Initializing nextcloud 23.0.4.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted

The new lock file was created:

-rw-r--r-- 1 root root 0 May  8 10:35 nextcloud-init-sync.lock

Any hints to solve that problem?

@protree
Copy link

protree commented May 21, 2022

Hi,

had the same problem updating from 22.2.7.1 to 22.2.8.1. The "nextcloud-init-sync.lock" on my system was created during the previous update according to its timestamp. This previous update failed because of the "Allowed memory size of xxx bytes exhausted" and I had to run "occ upgrade" manually.

After removing the "nextcloud-init-sync.lock" file the update went smooth.

@meonkeys
Copy link
Contributor

meonkeys commented May 21, 2022

Maybe we can avoid having to manually delete nextcloud-init-sync.lock if an upgrade fails halfway.

Please see #1756

Feedback appreciated!

@Mape6
Copy link

Mape6 commented May 22, 2022

I did another investigation and deleted the lock file many times.
After some time I found out that if I run the nextcloud container as priviliged, the error touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted does not happen again and I could upgrade to 23.0.4.

@Mape6
Copy link

Mape6 commented May 22, 2022

Regarding docker-entrypoint.sh The command runs as root not as www-data. I'm not really sure but wouldn't it be better if it is executed with runs_as 'touch $lock'

@apjyotirmay
Copy link

Facing the same issue, tried upgrading from 23.0.5 to 24.0.1

docker-compose.yml

version: '2'

volumes:
  redis:
    driver: local

services:
  app:
    build:
      context: ./
      dockerfile: Dockerfile.nextcloud
    restart: always
    container_name: nc_app
    working_dir: /var/www/html
    depends_on:
      - redis
      - db
    networks:
      - nextcloud
    volumes:
      - <redacted>
    environment:
      - MYSQL_PASSWORD=<redacted>
      - MYSQL_DATABASE=<redacted>
      - MYSQL_USER=<redacted>
      - MYSQL_HOST=db
      - REDIS_HOST=redis

  db:
    build:
      context: ./
      dockerfile: Dockerfile.mariadb
    container_name: nc_db
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    networks:
      - nextcloud
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=<redacted>
      - MYSQL_PASSWORD=<redacted>
      - MYSQL_DATABASE=<redacted>
      - MYSQL_USER=<redacted>

  redis:
    image: redis:6.2-alpine
    container_name: nc_redis
    restart: always
    networks:
      - nextcloud

  nginx:
    image: nginx:1.21.5-alpine
    container_name: nc_web
    restart: unless-stopped
    working_dir: /var/www/html
    networks:
      - nextcloud
    ports:
      - 8080:80
    depends_on:
      - app
    volumes:
      - ./nginx:/etc/nginx/conf.d:ro
    volumes_from:
      - app

networks:
  nextcloud:
    external: true

Dockerfile.nextcloud

FROM nextcloud:24.0.1-fpm-alpine
RUN apk --no-cache add shadow && \
    groupmod --gid 1001 www-data && \
    usermod --uid 1000 www-data

Dockerfile.mariadb

FROM mariadb:10.7
RUN groupmod --gid 1001 mysql && \
    usermod --uid 1000 mysql

@fuomag9
Copy link

fuomag9 commented May 23, 2022

I had to delete the nextcloud-init-sync.lock file in order to fix this

@meonkeys
Copy link
Contributor

@skjnldsv would you mind taking a peek at my patch? #1757

@ferdiga
Copy link

ferdiga commented May 27, 2022

docker

  • 24.0.0 works
  • 24.0.1 NOT !! - "Another process is initializing Nextcloud. Waiting 10 seconds..."

@TechieAndroid
Copy link

How do I roll back the update?
Every time I delete the new docker image and load the previous one it just auto pulls down the update and breaks my configs.

@ferdiga
Copy link

ferdiga commented Jun 2, 2022

image=Nextcloud:24.0.0 works for me

@TechieAndroid
Copy link

image=Nextcloud:24.0.0 works for me

I don't know how to specify that version in docker-compose so maybe that's my issue, docker-compose is pulling from nextcloud and that's going to be the latest package on docker hub. I need a way to limit the version it's pulling in my compose file.

@ferdiga
Copy link

ferdiga commented Jun 2, 2022

add the version number to nextcloud as mentioned above

@TechieAndroid
Copy link

I had to delete all my data in nextcloud/apps,data,mariadb,config,html and start fresh because everytime I tried to start the previous image it gave me a generic server error as long as I had my data in nextcloud/.

Maybe when it pulled the new version and started up it overwrote some of my data from 24.0.0 making it impossible to roll back keeping my data in tact.

@skjnldsv
Copy link
Member

skjnldsv commented Jun 2, 2022

For anyone willing to help, please review #1760

@meonkeys
Copy link
Contributor

meonkeys commented Jun 7, 2022

For anyone willing to help, please review #1760

:shipit:

@MrEAlderson
Copy link

Got a clean installation on a Raspberry Pi 4 and the issue is still present.
I tried nextcloud:latest, nextcloud:production, nextcloud:stable, nextcloud:24.0, nextcloud:24 and nextcloud:23, and it all did not work.

My logs show the following:

Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...

Deleting the file, trying to mess with permissions and everything didn't seem to help.

@hardwareadictos
Copy link

Having the same issue upgrading from 24.0.4.0 to 24.0.5/6.0 :

Nextcloud-PRO | Configuring Redis as session handler
Nextcloud-PRO | Initializing nextcloud 24.0.6.1 ...
Nextcloud-PRO | Upgrading nextcloud from 24.0.4.1 ...
Nextcloud-PRO | ls: can't open '/var/www/html/data/': Permission denied
Nextcloud-PRO | rsync: [generator] chgrp "/var/www/html/data" failed: Operation not permitted (1)
Nextcloud-PRO | rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1327) [sender=3.2.5]

That's a disaster, not upgrading even deleting the lock file :(

Permissions weren't even touched/changed.

@MrEAlderson
Copy link

Got a clean installation on a Raspberry Pi 4 and the issue is still present. I tried nextcloud:latest, nextcloud:production, nextcloud:stable, nextcloud:24.0, nextcloud:24 and nextcloud:23, and it all did not work.

My logs show the following:

Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...

Deleting the file, trying to mess with permissions and everything didn't seem to help.

This was only present with the 32bit os. It worked just fine after I reinstalled it with 64bit

@fuomag9
Copy link

fuomag9 commented Oct 14, 2022

This was only present with the 32bit os. It worked just fine after I reinstalled it with 64bit

Bug is arch-independent, managed to reproduce this on 64-bit as well

@hardwareadictos
Copy link

Got a clean installation on a Raspberry Pi 4 and the issue is still present. I tried nextcloud:latest, nextcloud:production, nextcloud:stable, nextcloud:24.0, nextcloud:24 and nextcloud:23, and it all did not work.
My logs show the following:

Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...
touch: setting times of '/var/www/html/nextcloud-init-sync.lock': Operation not permitted
Initializing nextcloud 24.0.5.1 ...

Deleting the file, trying to mess with permissions and everything didn't seem to help.

This was only present with the 32bit os. It worked just fine after I reinstalled it with 64bit

And i'm not running it on a Raspi, i'm doing on a Debian 64 bit VM and docker

@SeeYou1st
Copy link

Found a solution for me. I guess a reason for this error is this:
https://docs.linuxserver.io/faq#my-host-is-incompatible-with-images-based-on-ubuntu-focal

and a solution for my docker-comose file was to add 'seccomp:unconfined'. see here:
https://stackoverflow.com/questions/46053672/set-secomp-to-unconfined-in-docker-compose

update is now running...

but I'am not a docker/nextcloud expert. don't know if that's a good solution.

@imightbelosthere
Copy link

And another one to the pile... Simple upgrade on Docker Container to version 25.0.4 and guess what....

`flock: 9: No locks available

Another process is initializing Nextcloud. Waiting...`

Cycling on that since... ever...
Tried all the solutions here, none of them worked... :(

@imightbelosthere
Copy link

Found out that apparently we can't use NFS mounted volumes for Nextcloud configuration it seems... Somehow it breaks the process.
moved the data locally to the docker host and it worked without any issue then.

@aaronnad
Copy link

@imightbelosthere you are absoultely 100% correct for this.
I've been prying about for hours trying to figure this out.
The main /var/www/html directory cannot be on an NFS mount. I suspect this is due to the integration of FLOCK for file locking, which is now used in place of NEXTCLOUD_INIT_LOCK instead.

Apparently flock can be used with NFS, but it needs to be implemented in a specific way.

Starting nextcloud installation

An unhandled exception has been thrown:

Exception: Could not acquire a shared lock on the config file /var/www/html/config/apache-pretty-urls.config.php in /var/www/html/lib/private/Config.php:229

Stack trace:

You also need to ensure the specific /var/www/html/config is also on a non NFS mount as well

custom_apps and data appear to support NFS mounts at present still

@J0WI J0WI unpinned this issue Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.