sxyazi/yazi · error · anyhow::Error

Failed to work on: {task:?}: remote file has changed during

Error message

Failed to work on: {task:?}: remote file has changed during upload

What it means

Error "Failed to work on: {task:?}: remote file has changed during upload" thrown in sxyazi/yazi.

Source

Thrown at yazi-scheduler/src/file/file.rs:452

			ctx!(task, Transaction::tmp(&task.target).await, "Cannot determine temporary upload path")?;
		let mut rx = ctx!(
			task,
			engine::copy_progressive(cache, &tmp, Attrs {
				mode:  Some(cha.mode),
				atime: None,
				btime: None,
				mtime: None,
			})
			.await
		)?;

		loop {
			match rx.recv().await.unwrap_or(Ok(0)) {
				Ok(0) => {
					let cha =
						ctx!(task, Self::cha(&task.target, true, None).await, "Cannot stat original file")?;
					if stamp.sig() != cha.hash_u128_str(&mut [0; 26]) {
						Err(anyhow!("Failed to work on: {task:?}: remote file has changed during upload"))?;
					}

					ctx!(task, engine::rename(&tmp, &task.target).await, "Cannot persist uploaded file")?;

					let cha =
						ctx!(task, Self::cha(&task.target, true, None).await, "Cannot stat uploaded file")?;
					ctx!(task, Stamp::write(cha, task.target.as_url()).await)?;

					break;
				}
				Ok(n) => self.ops.out(task.id, FileOutUploadDo::Adv(n)),
				Err(e) => ctx!(task, Err(e))?,
			}
		}
		Ok(self.ops.out(task.id, FileOutUploadDo::Succ))
	}

	pub(super) async fn cha<U>(url: U, follow: bool, dent: Option<DirEntry>) -> io::Result<Cha>

View on GitHub (pinned to 94abcfa92f)

When it happens

Trigger: Thrown at yazi-scheduler/src/file/file.rs:452 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sxyazi/yazi@94abcfa92f (2026-08-16). Data as JSON: /api/errors/96fb02306a249e20. Report an issue: GitHub.