Skip to content

CLI Upgrade: stat: illegal option -- c #28758

Closed

Description

@tuaris

Steps to reproduce

  1. Upgrade to 10.0.2
  2. Run upgrade in browser
  3. Run upgrade in console (php occ upgrade)

Expected behavior

Upgrade should complete

Actual behavior

Browser based upgrade fails. Console based upgrade does not complete. Error messages shown are

stat: illegal option -- c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...]

Server configuration

Operating system: FreeBSD 10.3

Web server: Apache 2.4

Database: MySQL 5.6

PHP version: 5.6

ownCloud version: 10.0.2

Updated from an older ownCloud or fresh install: Update from 9.x

Where did you install ownCloud from: FreeBSD Ports

Signing status (ownCloud 9.0 and above):

Unable to sign in.

Activity

  1. DeepDiver1975 commented on Aug 21, 2017

    @DeepDiver1975
    Contributor

    The code in question is here

    if (strpos($os, 'linux') !== false) {
    $result = $this->exec("stat -c %s $arg");
    } else if (strpos($os, 'bsd') !== false || strpos($os, 'darwin') !== false) {
    $result = $this->exec("stat -f %z $arg");
    } else if (strpos($os, 'win') !== false) {
    $result = $this->exec("for %F in ($arg) do @echo %~zF");
    if (is_null($result)) {
    // PowerShell
    $result = $this->exec("(Get-Item $arg).length");
    }
    }
    return $result;

  2. DeepDiver1975 commented on Aug 21, 2017

    @DeepDiver1975
    Contributor

    Looks like your OS is detected as linux and not as bsd ...

    Please run this in your terminal

    php -r "echo php_uname('s') . PHP_EOL;"
  3. DeepDiver1975 commented on Aug 21, 2017

    @DeepDiver1975
    Contributor

    FYI: This code is triggered mainly because you are running a 32 bit and not 64 bit architecture

  4. tuaris commented on Aug 21, 2017

    @tuaris
    Author
     php -r "echo php_uname('s') . PHP_EOL;"
    FreeBSD
    

    This is 32-bit (yes I know I should upgrade to 64-bit ).

  5. phil-davis commented on Aug 22, 2017

    @phil-davis
    Contributor

    filemtime checks have a stat -c command that only has the case for Linux. Maybe #28759 will help?

  6. phil-davis commented on Aug 24, 2017

    @phil-davis
    Contributor

    Should be fixed with #28759 and backport to stable10 #28790

  7. lock commented on Aug 1, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  8. locked as resolved and limited conversation to collaborators on Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions