text icon indicating copy to clipboard operation
text copied to clipboard

text: Conflict during file save, please resolve

Open cryptomilk opened this issue 10 months ago • 4 comments

Please make a clear and concise description of what the bug is.

As soon as I try to edit markdown files, I run into conflict issues. In the browser developer console I get:

[ERROR] text: Conflict during file save, please resolve 
[ERROR] text: Conflict during file save, please resolve 

More details below.

Steps to reproduce

  1. Visit https://cloud.cryptomilk.org/s/5cGP5nZoztasci7 (valid till: 2025-02-14)
  2. Choose one document
  3. Check dev console

Expected behaviour

File should be saved and be able to edit it.

Actual behaviour

Error: text: Conflict during file save, please resolve

Server

Please complete the following information.

  • Notes app version: 4.10.1
  • Nextcloud version: nextcloud-30.0.5-lp156.1.2.noarch
  • OS: openSUSE 15.6
  • Web server: apache2-2.4.58-150600.5.29.1.x86_64
  • PHP version: php8-8.2.26-150600.3.9.1.x86_64
  • Database: postgresql-17-150600.17.6.1.noarch

Nextcloud configuration:

{                                                                                                                                                                                  [9/102]
    "system": {   
        "installed": true,                                                                   
        "dbtype": "pgsql",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",     
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "cld_",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "theme": "",                                                                         
        "defaultapp": "files",
        "knowledgebaseenabled": true,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": false,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "DE",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "appstoreenabled": false,
        "appcodechecker": true,
        "apps_paths": [
            {
                "path": "\/srv\/www\/vhosts\/nextcloud\/public\/apps",
                "url": "\/apps",
                "writable": false
            }
        ],
        "updatechecker": true,
        "updater.release.channel": "stable",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "version": "30.0.5.1",
        "maintenance": false,
        "trusted_domains": [
            "cloud.cryptomilk.org"
        ],
        "htaccess.RewriteBase": "\/",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trashbin_retention_obligation": "auto",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "logfilemode": 432,
        "loglevel": 2,
        "overwrite.cli.url": "https:\/\/cloud.cryptomilk.org",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "config_is_read_only": true
    }
}

Client

  • Browser (incl. version): Firefox 134.0.2
  • OS: openSUSE Tumbleweed

Log files

XHRPOST
https://cloud.cryptomilk.org/apps/text/session/312612/sync
[HTTP/2 409  138ms]

	
POST
	https://cloud.cryptomilk.org/apps/text/session/312612/sync
Status
409
VersionHTTP/2
Transferred3.14 kB (2.38 kB size)
Referrer Policyno-referrer
DNS ResolutionSystem

    	
    cache-control
    	no-cache, no-store, must-revalidate
    content-length
    	2381
    content-security-policy
    	default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'
    content-type
    	application/json; charset=utf-8
    date
    	Fri, 07 Feb 2025 10:28:40 GMT
    feature-policy
    	autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'
    referrer-policy
    	no-referrer
    server
    	Apache
    strict-transport-security
    	max-age=15768000; includeSubDomains
    x-content-type-options
    	nosniff
    X-Firefox-Spdy
    	h2
    x-frame-options
    	SAMEORIGIN
    x-permitted-cross-domain-policies
    	none
    x-powered-by
    	PHP/8.2.26
    x-request-id
    	Fz1ZfcncKqbkBIq3D3Br
    x-robots-tag
    	noindex, nofollow
    x-xss-protection
    	1; mode=block
    	
    Accept
    	application/json, text/plain, */*
    Accept-Encoding
    	gzip, deflate, br, zstd
    Accept-Language
    	en-US,en;q=0.5
    Connection
    	keep-alive
    Content-Length
    	227
    Content-Type
    	application/json
    Cookie
    	__Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=asn; nc_token=XXX
    DNT
    	1
    Host
    	cloud.cryptomilk.org
    Origin
    	https://cloud.cryptomilk.org
    requesttoken
    	XXX
    Sec-Fetch-Dest
    	empty
    Sec-Fetch-Mode
    	cors
    Sec-Fetch-Site
    	same-origin
    Sec-GPC
    	1
    TE
    	trailers
    User-Agent
    	Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0
    X-Requested-With
    	XMLHttpRequest, XMLHttpRequest

[ERROR] text: Conflict during file save, please resolve 
Object { app: "text", uid: "asn", level: 2 }
index-DtTpkYe5.chunk.mjs:1:1057
    log https://cloud.cryptomilk.org/apps/text/js/index-DtTpkYe5.chunk.mjs:1
    error https://cloud.cryptomilk.org/apps/text/js/index-DtTpkYe5.chunk.mjs:1
    _handleError https://cloud.cryptomilk.org/apps/text/js/Editor-CT2H8SzY.chunk.mjs:2
    (Async: promise callback)
    _fetchSteps https://cloud.cryptomilk.org/apps/text/js/Editor-CT2H8SzY.chunk.mjs:2

cryptomilk avatar Feb 07 '25 10:02 cryptomilk

Does this happen in the Text app (i.e. when accessed from Files) too or from Notes?

joshtrichards avatar Mar 11 '25 20:03 joshtrichards

I access it from Files, then this is probably the wrong app I reported the bug against.

cryptomilk avatar Mar 11 '25 20:03 cryptomilk

@cryptomilk if you open a markdown file from the Files app, this opens the Nextcloud Text editor, which is in this very repo. So you reported it at the right place 😊

Some questions to get a better understanding:

  • Do you experience this with one particular file or with different/all markdown files?
  • Does it happen all the time you open a markdown file or only sometimes?
  • Does this only happen for existing markdown files, or also if you create a new markdown file using the plus button in the Files app?
  • Do you use the Nextcloud Desktop sync client?
  • Can you please provide a screenshot of the editor when running into this error?

mejo- avatar Apr 02 '25 15:04 mejo-

  1. Create a markdown file text.md
  2. Open the text.md
  3. Write some text
  4. Close it
  5. Open it again and I get the error

Looking at the console it seems to fail to save it. But if I can create a file and upload files, why shouldn't I not be able to save the text file? There is no issue with any other file including onlyoffice. It is just this text app.

Image

cryptomilk avatar Apr 02 '25 17:04 cryptomilk

Might be resolved by #7677 as well

juliusknorr avatar Oct 09 '25 18:10 juliusknorr

I had the same problem where the text app would complain that there is a conflict and would fail to save files on NC 32.0.2. The related errors were:

{"reqId":"IFJp3OtUYcsqQjF9DWHE","level":2,"time":"2025-11-20T17:58:00+00:00","remoteAddr":"10.42.5.234","user":"leonardo","app":"PHP","method":"POST","url":"/index.php/apps/text/session/291588/save","message":"file_put_contents(/nfs/cloud/data/appdata_oc6pscrih1eo/text/documents/291588.yjs): Failed to open stream: No such file or directory at /usr/share/webapps/nextcloud/lib/private/Files/Storage/Local.php#302","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0","version":"32.0.2.2","data":{"app":"PHP"}}
{"reqId":"IFJp3OtUYcsqQjF9DWHE","level":3,"time":"2025-11-20T17:58:00+00:00","remoteAddr":"10.42.5.234","user":"leonardo","app":"text","method":"POST","url":"/index.php/apps/text/session/291588/save","message":"Could not create path \"/appdata_oc6pscrih1eo/text/documents/291588.yjs\"","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0","version":"32.0.2.2","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create path \"/appdata_oc6pscrih1eo/text/documents/291588.yjs\"","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/lib/private/Files/SimpleFS/NewSimpleFile.php","line":103,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/text/lib/Service/DocumentService.php","line":199,"function":"putContent","class":"OC\\Files\\SimpleFS\\NewSimpleFile","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/text/lib/Service/DocumentService.php","line":437,"function":"writeDocumentState","class":"OCA\\Text\\Service\\DocumentService","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Files/Lock/LockManager.php","line":58,"function":"OCA\\Text\\Service\\{closure}","class":"OCA\\Text\\Service\\DocumentService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/webapps/nextcloud/apps/text/lib/Service/DocumentService.php","line":429,"function":"runInScope","class":"OC\\Files\\Lock\\LockManager","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/text/lib/Service/ApiService.php","line":269,"function":"autosave","class":"OCA\\Text\\Service\\DocumentService","type":"->"},{"file":"/usr/share/webapps/nextcloud/apps/text/lib/Controller/SessionController.php","line":88,"function":"save","class":"OCA\\Text\\Service\\ApiService","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":204,"function":"save","class":"OCA\\Text\\Controller\\SessionController","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/share/webapps/nextcloud/index.php","line":25,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/share/webapps/nextcloud/lib/private/Files/Node/Folder.php","Line":175,"message":"Could not create path \"/appdata_oc6pscrih1eo/text/documents/291588.yjs\"","exception":{},"CustomMessage":"Could not create path \"/appdata_oc6pscrih1eo/text/documents/291588.yjs\""}}

Upon inspection of /data/appdata_oc6pscrih1eo/text, there was no documents directory for some reason. There was a documents_old_1762109792 though. I simply created the directory at /data/appdata_oc6pscrih1eo/text/documents and now it works again.

LMBishop avatar Nov 20 '25 18:11 LMBishop

@LMBishop the error Could not create path "/appdata_oc6pscrih1eo/text/documents/291588.yjs" sounds suspicious. Do you have the folder /appdata_oc6pscrih1eo/text/documents on your instance? Also do you use any special network/cluster filesystem setup for storage?

mejo- avatar Nov 24 '25 13:11 mejo-

No I did not have that directory, which is why I recreated it manually, after which it all started working again. I got some advice on IRC to rename the documents_old_1762109792 directory I had back to documents which had the same effect.

I am not sure why my documents directory disappeared. Perhaps an update removed it, as evidenced by the documents_old_1762109792 directory, but I do not know enough about this. The filesystem is a NFS mount, but I do not see a scenario where only this specific app would be affected by that. Either way, it works now as intended after recreating that directory.

LMBishop avatar Nov 24 '25 14:11 LMBishop