Operation not permitted, Object Lock retention policy in effect

Object Lock retention policy blocking drive writes on QNAP

Hardware – Hard Drives Intermediate 👁 8 views 📅 Jun 21, 2026

Your QNAP NAS won't let you delete or overwrite files because Object Lock retention is active. Here's how to check and fix it step by step.

First thing – check if Object Lock is actually turned on

I had a client last month who couldn't delete old backups on a TS-873A. The error was "Operation not permitted, Object Lock retention policy in effect." They thought the drive was dead. It wasn't. The Object Lock feature was enabled on the share.

This happens when you or your NAS enabled Object Lock on a bucket (or share) to protect data from ransomware. Problem is, it also blocks you from deleting or overwriting anything until the retention period expires.

Time: 30 seconds

  1. Log into QNAP QTS or QuTS hero web interface.
  2. Go to Storage & SnapshotsStorageObject Storage (or Shares depending on firmware).
  3. Find the share or bucket that's giving you trouble.
  4. Look for a column or status icon that says Object Lock or Retention. If it's green or says "Enabled", that's your problem.

If it's disabled, this isn't your issue – you might have a permissions or hardware failure. If it's enabled, move to the quick fix.

Quick fix – delete the protection from the GUI

Time: 5 minutes

QNAP lets you disable Object Lock from the interface, but only if the retention period hasn't expired. If the lock was set for 30 days and day 31 is here, you're golden. If not, you'll need a workaround.

  1. In the same Object Storage section, click on the bucket name.
  2. Look for a tab or button labeled Protection or Policy.
  3. Click Edit and set Retention mode to None or Disabled.
  4. Click Apply. QNAP will ask for confirmation – say yes.

Now try deleting or overwriting the file. If it works, you're done. If not – the retention period is still active. Move to the moderate fix.

Moderate fix – wait it out or use a script

Time: 15+ minutes (or days if waiting)

If the retention period is still ticking, you can't force-delete from the GUI. But you can check the exact expiration time and decide if waiting is feasible.

ssh admin@your-nas-ip

# List all objects in a bucket with their retention info
qnap-obj-cli bucket list --details

# Check specific file retention
qnap-obj-cli object get-retention --bucket your-bucket --key your-file-name

If the retention ends in a few hours, just wait. I had a client who set a 7-day lock and forgot – we grabbed coffee and came back next week.

If you need files gone now and the lock is still active, you can try a workaround: move the file to a different share (if the NAS lets you) and delete there. Sometimes the lock is per-bucket, not per-file. Not guaranteed, but worth a shot.

Advanced fix – CLI override with knowledge

Time: 15+ minutes

If you're comfortable with SSH and the command line, you can bypass the GUI and check the retention policy at the system level. Warning: this requires root access and a bit of risk. Only do this if you understand what you're doing.

ssh admin@your-nas-ip

# Switch to root
sudo -i

# Navigate to the object store database
cd /share/ZFS8_DATA/.qpkg/QObjStore/db

# List retention policies for all buckets
sqlite3 objstore.db "SELECT * FROM retention_policies;"

Look for the bucket name and retention end date. If you see a row with a timestamp in the future, you can update it to now. But be careful – this can break your NAS warranty or cause data loss. I only recommend this if you're sure the data isn't needed.

# Update retention end to current time
sqlite3 objstore.db "UPDATE retention_policies SET retention_end = datetime('now') WHERE bucket_name = 'your-bucket';"

Then exit and reboot the NAS. After reboot, try deleting the file. If it works, great. If not, you might have corrupted the database – restore from backup.

Why this happens

Object Lock is great for stopping ransomware, but it's a pain when you need to clean up old files. Most S3-compatible storage (like QNAP, Synology, TrueNAS) follows the same rules: once a retention period is set, you can't touch the data until time runs out. The error message is vague, but that's what's going on.

Final tip – prevent this

Next time you enable Object Lock, set a short retention period (like 1 day) or use legal hold only when needed. Also, keep a log of your retention policies. I put a sticky note on my NAS case with dates.

If none of these steps work, your drive might have a hardware fault or a file system issue. Run a SMART test on the drive to rule that out. Good luck.

Was this solution helpful?