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

Unable to create and add files and folders #1120

Open
kabia06 opened this issue Feb 29, 2024 · 13 comments
Open

Unable to create and add files and folders #1120

kabia06 opened this issue Feb 29, 2024 · 13 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working

Comments

@kabia06
Copy link

kabia06 commented Feb 29, 2024

Hello,

I'm experiencing a persistent problem on our Nextcloud server, where our Guest users are unable to upload files or create folders, consistently receiving an HTTP 403 (Access Denied) error. This problem directly affects sharing functionality and collaboration with external users. Below you'll find a detailed description of the problem, the error messages observed, and the checks and resolution attempts already undertaken.

Problem description :
Guest users, when attempting to upload a file or create a folder via the web interface receive an HTTP 403 error. This problem seems to be specific to Guest users, as regular users do not encounter similar issues.

Error messages observed :
Attempted actions by Guest users generate the following error messages in Nextcloud access logs:

When attempting to upload a file: "PUT /remote.php/dav/files/myaccount%40gmail.com/Capture%20d%E2%80%99e%CC%81cran%202022-09%20a%CC%80%2014.31.48.png HTTP/1.1" 403 1403
When attempting to create a folder: "MKCOL /remote.php/dav/files/myaccount%40gmail.com/New%20folder HTTP/1.1" 403 1403

Actions already taken :
File system permissions have been checked and adjusted to ensure that the web server user has the appropriate rights to write to the Nextcloud data directory.

No specific rules blocking PUT or MKCOL methods were identified in the web server configuration files or in Nextcloud's .htaccess file.

No applications or configurations within Nextcloud were identified as being able to restrict the actions of Guest users. The list of installed applications was provided to examine possible sources of conflict.

File upload and folder creation functions work normally for regular users, indicating that the problem is specific to Guest users.

I'm asking for your help in identifying and resolving the problem of access denied to Guest users. Any guidance or suggestions on further steps to be taken would be greatly appreciated. Also, if any additional information or logs are needed, please let me know.

Thank you in advance for your time and assistance.

@skjnldsv
Copy link
Member

Hey!

Any errors in your nextcloud.log ?
When you say upload, for the guest, you mean via web? Or via a client?

@skjnldsv skjnldsv added bug Something isn't working 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Feb 29, 2024
@kabia06
Copy link
Author

kabia06 commented Mar 1, 2024

Hello,

Thank you for your feedback @skjnldsv .

Yes, in the Nextcloud.log file I have some information. What I mean is that when I try to create a folder or upload a file, nothing appears in this log file. However, when I try to create a text file, I do have logs that appear. Here are the logs in question:
{"reqId":"1iJDYtUvBK1tyjJbUq92","level":3,"time":"2024-03-01T08:37:02+00:00","remoteAddr":"MY_IP_ADDRESS»user":"mymail@gmail.com","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/templates/create","message":"No create permission for path \"Nouveau fichier texte.md\"","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0","version":"28.0.2.5","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"No create permission for path \"Nouveau fichier texte.md\"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Template/TemplateManager.php","line":162,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/TemplateController.php","line":80,"function":"createFromTemplate","class":"OC\\Files\\Template\\TemplateManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"create","class":"OCA\\Files\\Controller\\TemplateController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","Line":199,"message":"No create permission for path \"Nouveau fichier texte.md\"","exception":{},"CustomMessage":"No create permission for path \"Nouveau fichier texte.md\""}}

When I say file upload, I mean file upload via web interface. The tests are carried out via the web interface. I've never run the tests via the client.

For your information, the tests are performed from different browsers (Firefox and Google Chrome). Furthermore, the logs I provided in my initial message are logs that appear in the file /var/log/apache2/nextcloud.access
Also, here's my Nextcloud version:

sudo -u www-data php occ -V
Nextcloud 28.0.2

Version of Guests plugin:
guests: 3.0.1

Thank you.

@skjnldsv
Copy link
Member

skjnldsv commented Mar 1, 2024

What quota has your guest user?

@kabia06
Copy link
Author

kabia06 commented Mar 1, 2024

When I create a user with Guests there is no default quota, it doesn't seem to be taken into account. I change it manually to 10GB.

@skjnldsv
Copy link
Member

skjnldsv commented Mar 1, 2024

Can you do an occ user:info your-guest-userid ? :)

@skjnldsv
Copy link
Member

skjnldsv commented Mar 1, 2024

I just tested it, and it works fine, if I change the quota of the quest to something specific, it works.
Can you upgrade to latest 28.0.3 please? :)

@kabia06
Copy link
Author

kabia06 commented Mar 4, 2024

I am reaching out to inform you that, despite updating our Nextcloud server to version 28.0.3, the issue faced by Guest users persists. These users are still unable to create content (files, folders) or upload files to the server.

Disturbingly, the majority of these actions do not generate any error messages in the logs accessible through the Nextcloud web interface. However, an exception occurs when attempting to create text files, where we receive the following error: NotPermittedException No create permission for path "Nouveau fichier texte.md".

I have double-checked the settings of the Guest plugin, ensuring that all necessary applications were enabled for Guest accounts, but, unfortunately, this has not resolved the issue.

For reference, here are the details of the concerned Guest user account:

sudo -u www-data php occ user:info myaccount@gmail.com
- user_id: myaccount@gmail.com
- display_name: KABIA TEST
- email: myaccount@gmail.com
- cloud_id: myaccount@gmail.com@my-nextcloud.fr
- enabled: true
- groups:
  - guest_app
- quota: 10 GB
- storage:
  - free: 10737418240
  - used: 0
  - total: 10737418240
  - relative: 0
  - quota: 10737418240
- last_seen: 2024-03-01T08:36:25+00:00
- user_directory: /data/nextcloud-data/myaccount@gmail.com
- backend: Guests

I appreciate your prompt attention and support in resolving this issue. Should you require any additional information or specific logs to diagnose this problem, please do not hesitate to ask.

Thank you in advance for your help.

Best regards,

@skjnldsv
Copy link
Member

skjnldsv commented Mar 5, 2024

I will need a screenshot of your network requests.
Before you do anything, still on the development tools, there is a tab called network. Click on it and then the xhr filter. Do your action and screenshot the network log like this:
capture d ecran_2018-09-27_21-49-46

@kabia06
Copy link
Author

kabia06 commented Mar 6, 2024

Hello,

I'm sharing the observations you requested. I tried to perform the same actions discussed on the Guest account. Here are the three actions I undertook in order:

  1. Creation of a text file
  2. Creation of a folder
  3. Upload of a file
Capture d’écran 2024-03-06 à 10 00 52

At each step, I received a 403 response for my requests. This indicates that access was denied for these specific actions on the Guest account.

Thank you in advance for your feedback and assistance!

Best regards,

@skjnldsv
Copy link
Member

skjnldsv commented Mar 7, 2024

Can you post the content of the first 403? (or all of them) ?
Click on it, and you'll see the response tab

@kabia06
Copy link
Author

kabia06 commented Mar 11, 2024

Here are the results of the various queries in the following order:

  • Folder creation
  • File creation
  • Upload a file (an image)

New folder :

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
  <s:message/>
</d:error>

New document :

{
	"ocs": {
		"meta": {
			"status": "failure",
			"statuscode": 403,
			"message": "Impossible de créer le fichier à partir du modèle"
		},
		"data": []
	}
}

Upload file :

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
  <s:message/>
</d:error>

@usselite
Copy link
Member

usselite commented Apr 5, 2024

Can confirm that this is an issue in NC28.

@jospoortvliet
Copy link
Member

related to #1060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants