Occ files command missing in 13.0.6

Nextcloud version (eg, 12.0.2): 13.0.6
Operating system and version (eg, Ubuntu 17.04): Debian 9.5
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.25
PHP version (eg, 7.1): 7.0

The issue you are facing: Since upgrading to v13.0.6, occ files command does not exist, so I cannot rescan my files. Had to downgrade back to 13.0.5 to run the occ files commands.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it: Upgrade to v13.0.6, run sudo -u www-data php occ upgrade. Then run sudo -u www-data php occ files:scan - it will error out saying files does not exist .

you need to add the path to the occ command

sudo -u www-data php /var/www/html/nextcloud/occ files:scan

That’s what I’m saying. I’m in the nextcloud directory so adding the full path isn’t necessary. I went back and double checked, it’s definitely not there in v3.0.6. How do I take a screenshot of the console so I can paste the screenshot here so you can see what I mean?

[quote]
sudo -u www-data php /var/www/html/nextcloud-13.0.6/occ files:scan

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

[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the “files” namespace. [/quote]

Here is the occ listing for v13.0.6:

[quote]
sudo -u www-data php /var/www/html/nextcloud-13.0.6/occ list
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
Nextcloud 13.0.6

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
–ansi Force ANSI output
–no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
–no-warnings Skip global warnings, show command output only
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
_completion BASH completion hook.
check check dependencies of the server environment
help Displays help for a command
list Lists commands
status show some status information
upgrade run upgrade routines after installation of a new release. The release has to be installed before.
app
app:check-code check code to be compliant
app:disable disable an app
app:enable enable an app
app:getpath Get an absolute path to the app directory
app:install install an app
app:list List all available apps
background
background:ajax Use ajax to run background jobs
background:cron Use cron to run background jobs
background:webcron Use webcron to run background jobs
config
config:app:delete Delete an app config value
config:app:get Get an app config value
config:app:set Set an app config value
config:import Import a list of configs
config:list List all configs
config:system:delete Delete a system config value
config:system:get Get a system config value
config:system:set Set a system config value
db
db:add-missing-indices Add missing indices to the database tables
db:convert-filecache-bigint Convert the ID columns of the filecache to BigInt
db:convert-mysql-charset Convert charset of MySQL/MariaDB to use utf8mb4
db:convert-type Convert the Nextcloud database to the newly configured one
encryption
encryption:change-key-storage-root Change key storage root
encryption:decrypt-all Disable server-side encryption and decrypt all files
encryption:disable Disable encryption
encryption:enable Enable encryption
encryption:encrypt-all Encrypt all files for all users
encryption:list-modules List all available encryption modules
encryption:set-default-module Set the encryption default module
encryption:show-key-storage-root Show current key storage root
encryption:status Lists the current status of encryption
group
group:adduser add a user to a group
group:list list configured groups
group:removeuser remove a user from a group
integrity
integrity:check-app Check integrity of an app using a signature.
integrity:check-core Check integrity of core code using a signature.
integrity:sign-app Signs an app using a private key.
integrity:sign-core Sign core using a private key.
l10n
l10n:createjs Create javascript translation files for a given app
log
log:file manipulate logging backend
log:manage manage logging configuration
maintenance
maintenance:data-fingerprint update the systems data-fingerprint after a backup is restored
maintenance:mimetype:update-db Update database mimetypes and update filecache
maintenance:mimetype:update-js Update mimetypelist.js
maintenance:mode set maintenance mode
maintenance:repair repair this installation
maintenance:theme:update Apply custom theme changes
maintenance:update:htaccess Updates the .htaccess file
migrations
migrations:execute Execute a single migration version manually.
migrations:generate
migrations:generate-from-schema
migrations:migrate Execute a migration to a specified version or the latest available version.
migrations:status View the status of a set of migrations.
security
security:certificates list trusted certificates
security:certificates:import import trusted certificate
security:certificates:remove remove trusted certificate
twofactorauth
twofactorauth:disable Disable two-factor authentication for a user
twofactorauth:enable Enable two-factor authentication for a user
user
user:add adds a user
user:delete deletes the specified user
user:disable disables the specified user
user:enable enables the specified user
user:info show user info
user:lastseen shows when the user was logged in last time
user:list list configured users
user:report shows how many users have access
user:resetpassword Resets the password of the named user
user:setting Read and modify user settings [/quote]

I don’t know what you did, but the current version of Nextcloud is 13.0.6 and not 3.0.6.

Doh! Yeah, that’s indeed the version I meant. Sorry for the typo.

If you continue facing this issue, try the files command again and be sure to have maintenance-mode off. That was my solution.

@wook

What am I doing wrong (My nextcloud 20.0.8 instance is running on a web hosting)?

I’m running the occ files:scan --all command but I also get this message:

There are no commands defined in the “files” namespace.

Is the “files” script or program missing somewhere or maybe not enabled of the hoster? Maintenance mode is off.

After searching a bit I found the following solution: There is an app to run occ commands via the web interface: OCC Web

There the files command where available and worked like a charm. :heart_eyes: