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

The new token is invalid #339

Open
europahaus opened this issue Dec 7, 2024 · 1 comment
Open

The new token is invalid #339

europahaus opened this issue Dec 7, 2024 · 1 comment

Comments

@europahaus
Copy link

Hello,

I love the “ShareRenamer” app! Unfortunately, I now have my first problem.

Our school has moved its Nextcloud to a new domain (let's call it new-domain.com). Unfortunately, certain data has not been copied. We were able to restore the old files via a backup. Some time ago (before the move and everything) we shared the files on the old cloud and printed and distributed them on many flyers using QR codes. As a result, many people can now after the move no longer access the files with the flyer. I had the following idea: The old domain automatically redirects to the new domain. For example, old-domain.com/index.php/s/4paMb4X6syNjj3f redirects to new-domain.com/index.php/s/4paMb4X6syNjj3f . I thought that if I shared the file on the new domain again and rename it with ShareRenamer to “4paMb4X6syNjj3f”, it should actually work again.
Now comes the problem: Unfortunately, I can't assign exactly this name. I can enter everything else, even longer and shorter names. Just not exactly 4paMb4X6syNjj3f . I suspect that the name has already been assigned when the cloud was copied. However, the corresponding file no longer exists. That's why I wanted to ask if there is a way around this. Is the name perhaps stored in a database? And if so, can I delete it somehow?

The exact error code is in German: "Fehler: Der Freigabe Link konnte nicht geändert werden: The new token is invalid"

In English: Error: The share link could not be changed: The new token is invalid

Can anyone help me?

Many thanks and best regards
Jonathan (europahaus)

@JonathanTreffler
Copy link
Owner

Yes, the problem is likely, that the old share still exists. I guess the steps of the move or backup restore were made in an suboptimal order, where all files got new fileIds.
When writing this reply I initially assumed nextcloud would probably delete shares of files, that no longer exist, but apparently it doesn't, maybe to prevent new randomly generated share links accidentally being the same as previous now-invalid share links.
You can remove the shares of deleted files (or shares created by someone who doesn't have access to the file anymore) with the occ sharing:delete-orphan-shares command, after which it should be possible to re-use the link (including using sharerenamer).

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

No branches or pull requests

2 participants