Upgrade from Admin: Operation not permitted

AI-generated summary

Upgrade from Admin: Operation not permitted

User hongquan is experiencing an “Operation not permitted” error when trying to upgrade Discourse from the Admin UI. The error occurs when attempting to unlink certain files in the /var/www/discourse/ directory, which is owned by the discourse user.

hongquan has tried rebuilding with the ./launcher command, which succeeds, but the issue persists when trying to upgrade from the Admin UI.

sam suggests that older versions may require a rebuild, but it should work fine going forward. However, hongquan reports that the issue continues even after rebuilding and updating.

hongquan suspects that the server’s outdated kernel version (3.5) may be the cause of the problem, as it is below Docker’s required version (3.10).

I tried to upgrade Discourse from Admin UI, but failed due to “Operation not permitted” error

$ cd /var/www/discourse && git fetch && git reset --hard HEAD@{upstream}
warning: unable to unlink app/assets/javascripts/admin/models/report.js: Operation not permitted
warning: unable to unlink app/assets/javascripts/discourse/templates/search/category_result.hbs: Operation not permitted
warning: unable to unlink app/assets/javascripts/discourse/templates/search/post_result.hbs: Operation not permitted

Tried looking for similar topic in this forum, but not found. So I have to create this topic. Here is the Linux account detail:

  • The docker software is installed with sudo apt-get, by kaka_root user. This user is normal user, but is “sudoer”.
  • The git repo discourse_docker is cloned by kaka_dev user. This user is not “sudoer”. This user can run ./launcher ssh app successfully, and become root inside container after that. This user can also run ./launcher rebuild app successfully.
  • Inside container, the folder /var/www/discourse/ is under discourse user.

Platform detail:
Linux hostname 3.5.0-52-generic #79~precise1-Ubuntu SMP Fri Jul 4 21:03:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

I can upgrade Discourse successfully with ./launcher command. But my team want to be able to do in Admin UI.

How can I solve this?
Thanks and regards.

Some older versions require a rebuild, once that is done it should be fine going forward.

I rebuilt by command line. After some days, Discourse had new update, tried from Admin but failed, had to rebuild by command line. After that, Discourse had new update again, tried to upgrade from Admin again and still not work.

— Update —
Just noticed that our server is using kernel v3.5, far older than Docker requirement, v3.10. This may be the cause of the problem.