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

[Bug]: InvalidTokenException Token does not exist: token does not exist Renewing session token failed: Token does not exist: token does not exist #43214

Closed
5 of 8 tasks
ghost opened this issue Jan 30, 2024 · 24 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: authentication needs review Needs review to determine if still applicable

Comments

@ghost
Copy link

ghost commented Jan 30, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

Getting this error on NC 28.0.2 RC5

Steps to reproduce

  1. Access server via web

Expected behavior

Should not see this error

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 22 to 23)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "REMOVED SENSITIVE VALUE"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.2.4",
        "overwrite.cli.url": "REMOVED SENSITIVE VALUE",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "simpleSignUpLink.shown": false,
        "skeletondirectory": "",
        "default_locale": "en_US",
        "default_phone_region": "US",
        "allow_local_remote_servers": true,
        "ffmpeg": "\/usr\/bin\/ffmpeg",
        "preview_max_memory": 1280,
        "enabledPreviewProviders": [
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Image",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\SVG",
            "OC\\Preview\\Font",
            "OC\\Preview\\MP3",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP4",
            "OC\\Preview\\AVI",
            "OC\\Preview\\MOV",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\MSOfficeDoc"
        ],
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "587",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "loglevel": 2,
        "logtimezone": "America\/Chicago",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "maintenance_window_start": 1,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "theme": "",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.gis_type": 1,
        "defaultapp": "dashboard,files,memories",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contactsinteraction: 1.9.0
  - dashboard: 7.8.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - impersonate: 1.15.0
  - integration_youtube: 0.1.5
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - memories: 6.2.2
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - notify_push: 0.6.8
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - previewgenerator: 5.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recognize: 6.1.0-beta.2
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.1
  - sendent: 2.0.5
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - spreed: 18.0.2
  - support: 1.11.0
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - text: 3.9.1
  - theming: 2.3.0
  - theming_customcss: 1.15.0
  - twofactor_admin: 4.4.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_email: 2.7.4
  - twofactor_nextcloud_notification: 3.8.0
  - twofactor_totp: 10.0.0-beta.2
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - circles: 28.0.0-dev (installed 27.0.1)
  - encryption: 2.16.0
  - user_ldap: 1.19.0

Nextcloud Signing status

No response

Nextcloud Logs

{"reqId":"cK33uNpbMOruhKG2c4uq","level":3,"time":"2024-01-30T09:15:40-06:00","remoteAddr":"10.241.202.1","user":"--","app":"core","method":"GET","url":"/","message":"Renewing session token failed: Token does not exist: token does not exist","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0","version":"28.0.2.4","exception":{"Exception":"OC\\Authentication\\Exceptions\\InvalidTokenException","Message":"Token does not exist: token does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":226,"function":"getToken","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OC\\Authentication\\Token\\{closure}","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":225,"function":"atomic","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/Manager.php","line":172,"function":"renewSessionToken","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":929,"function":"renewSessionToken","class":"OC\\Authentication\\Token\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1151,"function":"loginWithCookie","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":1058,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","Line":178,"Previous":{"Exception":"OCP\\AppFramework\\Db\\DoesNotExistException","Message":"token does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":169,"function":"getToken","class":"OC\\Authentication\\Token\\PublicKeyTokenMapper","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":226,"function":"getToken","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OC\\Authentication\\Token\\{closure}","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":225,"function":"atomic","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/Manager.php","line":172,"function":"renewSessionToken","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":929,"function":"renewSessionToken","class":"OC\\Authentication\\Token\\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1151,"function":"loginWithCookie","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":1058,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenMapper.php","Line":98},"message":"Renewing session token failed: Token does not exist: token does not exist","user":"axheli","exception":[],"CustomMessage":"Renewing session token failed: Token does not exist: token does not exist"},"id":"65b912d479636"}

Additional info

No response

@prismopensource
Copy link

prismopensource commented May 19, 2024

Having the exact same problem here with NC 28.0.5 with the user_external IMAP backend and normally authenticated users on PHP 8.2, this seems to happen after some inactivity from the end user. Really annoying with 2FA enabled since users have to log back in with password and second factor again every time this happens.

@unknownuserisknown
Copy link

I'm also having the same problem. Did not occur until I updated to NC 28.0.5. Session times out after relatively short period of inactivity.

@Gimly86
Copy link

Gimly86 commented May 22, 2024

Hello,

I'm having the same problem since updated to NC 28.0.5.
No problem before with 28.0.4.

@prismopensource
Copy link

Did anyone test whether this is also happening on NC 29?

@wentevill
Copy link

wentevill commented May 23, 2024

The same problem with NC 28.0.5, if user_external is enabled and users log in through it, other methods (such as web or desktop) will encounter issues within a few minutes.

@adsche
Copy link

adsche commented May 23, 2024

Did anyone test whether this is also happening on NC 29?

It is happening for us on NC 29. We're not using user_external that others mentioned, we use only SAML.
We switched to SAML recently; I assume for us it could be caused (like many other issues) from old (LDAP) usernames still in the system who have never logged in through SAML...?

@no-usernames-left

This comment was marked as spam.

@r4tt4
Copy link

r4tt4 commented May 29, 2024

Hi *,
to give an update from my side here: Since I installed the latest 28.0.6 Version of NC, the issue is gone. Seems fixed for me.

@prismopensource

This comment was marked as spam.

@unknownuserisknown
Copy link

I can also confirm that the issue goes away with 28.0.6. Pretty sure this backported fix was the issue: f09f4ec

@8phl69ohbwfg5pq7
Copy link

Upgraded from NC 27.1.9 (which worked fine) to 28.0.6 and ran into this error.
Did many attempts to fix it. Only thing that worked for me was reverting /lib/private/Authentication/Token/PublicKeyTokenProvider.php to that of NC 28.0.4. Downside of this workaround seems to be that user accounts can't delete app-token anymore.

@moboter
Copy link

moboter commented Jun 14, 2024

I only get the error on nextcloud 28.0.6 when the user has TOTP enabled

@xdubx

This comment was marked as spam.

@marchidaniele

This comment was marked as spam.

@MilestoneRob
Copy link

Following for an answer. Still getting this on 29.0.4

[core] Error: Renewing session token failed: Token does not exist: token does not exist

@drjagan
Copy link

drjagan commented Aug 6, 2024

Still getting the same error on 29.0.4
Looking for solutions

@til-jmac
Copy link

til-jmac commented Aug 6, 2024

Also getting the same error on 28.0.8

InvalidTokenException
Renewing session token failed: Token does not exist: token does not exist

@Ryonez
Copy link

Ryonez commented Aug 9, 2024

Facing this issue with 29.0.4 myself.

@kernie
Copy link

kernie commented Aug 19, 2024

Seems I'm in the boat, too...

I want to share a folder with password protection. When I open the shared page I'm stuck in a loop being asked for the password all the time.

In the logs I see the error message mentioned above.

Nextcloud 29.0.4

EDIT: I see the error message

[PHP] Fehler: TypeError: Cannot assign null to property OCA\Files_Sharing\Controller\ShareAPIController::$currentUser of type string at /srv/prvnxtcld/apps/files_sharing/lib/Controller/ShareAPIController.php#124

after I share the folder with password. Maybe related to #46081

@plopezllorca
Copy link

Same error here with 29.0.4

@XStylus
Copy link

XStylus commented Aug 31, 2024

Following for answer. Running 29.0.5.

@svenseeberg
Copy link

This happens to me when a logged in user opens a Collabora document with an external share link.

@joshtrichards joshtrichards added the needs review Needs review to determine if still applicable label Nov 6, 2024
@stobbsm
Copy link

stobbsm commented Nov 24, 2024

I'm having the same error, mostly related to talk. Upgraded to 30.0.2

@ghost ghost closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2024
@NEVARLeVrai
Copy link

same error

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: authentication needs review Needs review to determine if still applicable
Projects
None yet
Development

No branches or pull requests