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

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

Closed
tuaris opened this issue Aug 21, 2017 · 8 comments
Closed

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

tuaris opened this issue Aug 21, 2017 · 8 comments

Comments

@tuaris
Copy link

tuaris commented Aug 21, 2017

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.

@DeepDiver1975
Copy link
Member

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;

@DeepDiver1975
Copy link
Member

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;"

@DeepDiver1975
Copy link
Member

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

@tuaris
Copy link
Author

tuaris commented Aug 21, 2017

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

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

@phil-davis
Copy link
Contributor

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

@ghost
Copy link

ghost commented Aug 22, 2017

Ref: #28761

@phil-davis
Copy link
Contributor

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

@lock
Copy link

lock bot commented Aug 1, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants