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

Copying a file and renaming it in the same directory #2092

Open
pedropintosilva opened this issue Mar 10, 2022 · 6 comments · May be fixed by #4425
Open

Copying a file and renaming it in the same directory #2092

pedropintosilva opened this issue Mar 10, 2022 · 6 comments · May be fixed by #4425
Labels

Comments

@pedropintosilva
Copy link
Contributor

[to do: add description , test with other mime types]

Peek.2022-03-10.11-38.mp4
11:39:44.206 XHRMOVEhttps://staging.eu.collaboraonline.com/nextcloud/remote.php/dav/files/pedro.silva/COOL Weekly/COOLWeekly63 (copy).odt
[HTTP/1.1 500 Internal Server Error 115ms]

	
MOVE
	https://staging.eu.collaboraonline.com/nextcloud/remote.php/dav/files/pedro.silva/COOL%20Weekly/COOLWeekly63%20(copy).odt
Status500
Internal Server Error
VersionHTTP/1.1
Transferred880 B (235 B size)
Referrer Policyno-referrer

    	
    Cache-Control
    	no-store, no-cache, must-revalidate
    Connection
    	close
    Content-Length
    	235
    Content-Security-Policy
    	default-src 'none';
    Content-Type
    	application/xml; charset=utf-8
    Date
    	Thu, 10 Mar 2022 10:39:44 GMT
    Expires
    	Thu, 19 Nov 1981 08:52:00 GMT
    Pragma
    	no-cache
    Referrer-Policy
    	no-referrer
    Server
    	Apache
    Strict-Transport-Security
    	max-age=15768000; includeSubDomains; preload
    X-Content-Type-Options
    	nosniff
    X-Download-Options
    	noopen
    X-Frame-Options
    	SAMEORIGIN
    X-Permitted-Cross-Domain-Policies
    	none
    X-Powered-By
    	PHP/7.4.6
    X-Robots-Tag
    	none
    X-XSS-Protection
    	1; mode=block
    	
    Accept
    	*/*
    Accept-Encoding
    	gzip, deflate, br
    Accept-Language
    	en-GB,en;q=0.5
    Cache-Control
    	no-cache
    Connection
    	keep-alive
    Cookie
    	nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=pedro.silva; nc_token=xW2aoDllap3KLIRiXESnUdp20xRAD%2Bbe; nc_session_id=js1rjh98m5fs06mrg6mgs38vsq; oc_sessionPassphrase=Oc%2Bv7F6qBqLs1o7ZHNS6Y3HDM%2F47e%2B2R2Lmwohft4WQ51EtDhg8Vuzqr%2BoPCHFowa0XDcr0OomahYn%2Bc5g9pWzgevPAHMu2TBJCBLe6NC5vYyF3%2BX4S9TXx%2BOFjBhjDW; ocbizrjb36ht=js1rjh98m5fs06mrg6mgs38vsq
    Destination
    	https://staging.eu.collaboraonline.com/nextcloud/remote.php/dav/files/pedro.silva/COOL%20Weekly/COOLWeekly64.odt
    Host
    	staging.eu.collaboraonline.com
    Origin
    	https://staging.eu.collaboraonline.com
    Overwrite
    	F
    Pragma
    	no-cache
    requesttoken
    	VjiGMvB/bYM0q24l1MXOLRviw6oixsHMsvWNZ3uZ3+8=:Y0DDCro0H8Rz2lgV7aaGHEGh8vh2h5a9443CPQjj66o=
    Sec-Fetch-Dest
    	empty
    Sec-Fetch-Mode
    	cors
    Sec-Fetch-Site
    	same-origin
    User-Agent
    	Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
    X-Requested-With
    	XMLHttpRequest
@juliusknorr
Copy link
Member

HTTP/1.1 500 Internal Server Error

Do you see any error logged in the nextcloud log file about that?

@pedropintosilva
Copy link
Contributor Author

Warning    core    Controller OC\Core\Controller\PreviewController::getPreviewByFileId executed 3984 queries.        2022-04-28T11:22:12+0200
Fatal    webdav    OCP\Lock\LockedException: "COOL Weekly/COOLWeekly68 (copy).odt" is locked        2022-04-28T11:22:11+0200
Warning    core    Controller OC\Core\Controller\PreviewController::getPreviewByFileId executed 3964 queries.        2022-04-28T11:21:41+0200
Warning    recommendations    Controller OCA\Recommendations\Controller\RecommendationController::index executed 139 queries.        2022-04-28T11:21:29+0200
Warning    richdocuments    Controller OCA\Richdocuments\Controller\WopiController::putFile executed 158 queries.

@pedropintosilva
Copy link
Contributor Author

[core] Warning: Controller OC\Core\Controller\PreviewController::getPreviewByFileId executed 3984 queries.

GET /nextcloud/index.php/core/preview?fileId=191657&c=4d889ffd00314071fef2e8e0b224a8d7&x=250&y=250&forceIcon=0&a=0
from 185.151.169.3 by pedro.silva at 2022-04-28T09:22:12+00:00

@juliusknorr
Copy link
Member

Interesting, looking at the screencast again it looks like it might be related to the file being locked while generating the preview. I still cannot reproduce, but could you maybe check if renaming works fine after waiting for the preview of the new file being loaded?

@juliusknorr
Copy link
Member

From the code it could happen that especially if the convert-to endpoint responds slow, a stream is kept open and therefore blocking obtaining the exclusive lock that would be required for the rename. We could just always use a local tmp copy but might have some performance impact on larger files in

if ($useTempFile) {
$fileName = $fileview->toTmpFile($path);
$stream = fopen($fileName, 'r');
} else {
$stream = $fileview->fopen($path, 'r');
}

@mmeeks
Copy link
Contributor

mmeeks commented Jun 16, 2022

From the COOL call minutes:

Perhaps good to copy the file to a temp file when generating the preview.

		May fail for 600Mb PPTs.
	
	Internally we generate a high-quality pixel preview (Michael)
	
		partly because of hair-line issue → render it large & scale it.
		Possibly we could send it with the save → Post two things …
		no way to overwrite the preview outside of the preview paths (Julius)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants