Skip to content

Error when trying to update: Call to undefined function posix_getuid() #2165

Open

Description

@janvlug

I tried to update Nextcloudpi via the command line.

At a certain point this is reported:

Enabling conf php8.5-fpm.
To activate the new configuration, you need to run:
  systemctl reload apache2
Installing template 'systemd/php-fpm.service.d.ncp.conf.sh' to '/etc/systemd/system/php8.5-fpm.service.d/ncp.conf'...
Starting apache and php-fpm...
Warning: The unit file, source configuration file or drop-ins of php8.5-fpm.service changed on disk. Run 'systemctl daemon-reload' to reload units.

Fatal error: Uncaught Error: Call to undefined function posix_getuid() in /var/www/nextcloud/occ:15
Stack trace:
#0 /var/www/nextcloud/occ(32): dropPrivileges()
#1 {main}
  thrown in /var/www/nextcloud/occ on line 15
Something went wrong while upgrading PHP. Rolling back to version 8.3...

I tried the update to Nextcloud after an update of NextcloudPi to v1.59.0 which also gave some warnings. See: #2164

Activity

  1. janvlug commented on Nov 17, 2026

    @janvlug
    ContributorAuthor

    Here is the full log:

    log.txt

  2. guandalf commented on Nov 19, 2026

    @guandalf

    This happens to me as well. If it can help, I am running on an Odroid HC4.

  3. janvlug commented on Nov 19, 2026

    @janvlug
    ContributorAuthor

    I think that the posix module is somehow not loaded by PHP8.5. But I do not know why not.

  4. guandalf commented on Nov 19, 2026

    @guandalf
  5. guandalf commented on Nov 20, 2026

    @guandalf

    So, in my case, don't ask me why, I had the folder /etc/php/8.5 with permissions 750, likely before first installing PHP 8.5.
    The fix I applied is removing completely the folder 8.5 inside the /etc/php folder and run the update script again.
    Now I am happily on PHP 8.5.
    If you want to test it before upgrading the Nextcloud instance, just run the /usr/local/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh alone as root

  6. janvlug commented on Nov 20, 2026

    @janvlug
    ContributorAuthor

    I confirm I have that directory as well:

    root@nextcloudpi:~# ls -slad /etc/php/8.5
    4 drwxr-x--- 4 root root 4096 Nov 17 13:39 /etc/php/8.5
    root@nextcloudpi:~# find /etc/php/8.5
    /etc/php/8.5
    /etc/php/8.5/mods-available
    /etc/php/8.5/mods-available/opcache.ini
    /etc/php/8.5/fpm
    /etc/php/8.5/fpm/conf.d
    /etc/php/8.5/fpm/conf.d/20-opcache.ini
    /etc/php/8.5/fpm/conf.d/90-ncp.ini
    

    I will remove it and see if the update goes through...

  7. janvlug commented on Nov 20, 2026

    @janvlug
    ContributorAuthor

    I confirmed that removing the /etc/php/8.5 directory before running ncp-update-nc 33.0.11 also fixed this issue for me.

    I think that this issue was caused by the issue that I reported here: https://github.com/nextcloud/nextcloudpi/issues/2164

  8. Pyromane commented on Nov 21, 2026

    @Pyromane

    My installation was also affected by this, and after running rm -f -d -r /etc/php/8.5, the update completed without any issues.
    Thanks @guandalf for the solution!

  9. guandalf commented on Nov 22, 2026

    @guandalf

    I think this can be closed @janvlug (I do not have permission).
    🙏

  10. janvlug commented on Nov 22, 2026

    @janvlug
    ContributorAuthor

    I'm not sure that this can be closed. We found a way to fix the problem, when it occurs, but I'm not sure if the root cause has been resolved. I leave it up to @theCalcaholic to decide if this should be closed, or if the root cause should be found and solved (if still possible).

  11. sbe-nsp commented on Nov 23, 2026

    @sbe-nsp

    tried the update today and ran in the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions