Error HTTP 403 and 404 after trying a workaround to make occ work

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12
  • Web server and version (e.g, Apache 2.4.25):
    • NGINX 1.22.1-9
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • NGINX 1.22.1-9
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • no
  • When did this problem seem to first start?
    • The first time i launched the command
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Installation script
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

I’d like to use the occ command to perform some maintenance, but i’m facing error messages.
Could not open input file: occ
I tried a workaround mentioned here and typed the command chmod 744 /var/www/nextcloud, but it’s getting worse: now i have HTTP 403 and 404 errors. How to fix this ?

Steps to replicate it (hint: details matter!):

  1. Try a command implying occ
  2. chmod 744 /var/www/nextcloud

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

first fix your permissions:
undo your chmod 744 this is should be best at 750 drwxr-x—

How did you run the command?

1 Like

And for the record, that’s not what that linked post says to do. :wink:

The chmod target is occ not the folder.

You might also find the chapter covering occ of interest: Admin Manual: Using the occ command