olcli icon indicating copy to clipboard operation
olcli copied to clipboard

[Bug] Project rename fails with auth error

Open alessandrocornacchia opened this issue 3 weeks ago • 2 comments

What happened?

I cannot rename a project, and I receive a auth error even if my client is correctly authenticated

❯ olcli project rename --verbose "NIKA-CoNEXT27" "NIKA - CoNEXT'27"
⠴ Renaming project...[olcli] GET https://www.overleaf.com/project -> 200 (111082B text/html; charset=utf-8)
⠏ Renaming project...[olcli] POST https://www.overleaf.com/project/6aeb60f2660a43bca75ca065/rename -> 403 (37840B text/html; charset=utf-8) body=<!DOCTYPE html><html lang="en"><head><title translate="no">Restricted - Overleaf, Online LaTeX Editor</title><meta name="twitter:title" content="Restricted"><meta name="og:title" content="Restricted">
✖ Session expired or invalid. Run: olcli auth
  HTTP 403 while trying to: failed to rename project.

❯ olcli auth status
  Instance     https://www.overleaf.com
  Account      [email protected]
  Credential   config file (/Users/acornacchia/Library/Preferences/olcli-nodejs/config.json)
  Cookie       overleaf_session2 = ****2F5o (84 chars)
  Config file  /Users/acornacchia/Library/Preferences/olcli-nodejs/config.json
  Session      valid, 50 project(s)

Expected behavior: Project renamed, or more informative error message

Environment:

  • OS: MacOS
  • Version: 26.6.2 (25G83)

alessandrocornacchia avatar Nov 10 '26 11:11 alessandrocornacchia

Thanks for the detailed report and the verbose log, that helps a lot.

The 403 comes from Overleaf itself: the rename endpoint (POST /project//rename) only accepts requests from the project owner, and answers 403 to collaborators, even with full edit access. Your session is fine, as olcli auth status shows, so the "Session expired or invalid" hint is wrong here. That part is a bug in olcli, and I will make the message name the real cause.

To confirm the cause, could you check two things?

  1. Are you the owner of this project, or were you invited to it by someone else?
  2. Does renaming the same project work in the Overleaf web editor with the same account?

If you are the owner and the web editor can rename it, please tell me, then something else is going on and I will dig further.

aloth avatar Nov 10 '26 17:11 aloth

Thanks again for the report and the verbose log, they made this easy to track down. I could reproduce it with two accounts: renaming a project I own works, while renaming a project I was invited to fails with exactly the 403 and the "Session expired" message from your log, even though the session is valid. Overleaf only lets the project owner rename a project, and olcli reported that as a session problem.

This is improved in olcli 0.16.2: olcli project rename now checks the owner before sending anything and says "Only the project owner can rename a project. This project is owned by ." If Overleaf still answers 403, the message names the owner rule first and mentions olcli auth only as the second possibility. rename-bulk skips projects owned by someone else and lists them. To rename such a project, the owner needs to do it. If you are the owner and it still fails with 0.16.2, please reopen this issue.

aloth avatar Nov 11 '26 09:11 aloth