cursor-stats icon indicating copy to clipboard operation
cursor-stats copied to clipboard

No token found error after installing v1.1.2

Open pcarielo opened this issue 1 year ago • 24 comments

After installing version 1.1.2, Cursor Status won't show any info anymore. It show this red text at the status bar:

"Cursor Stats: No token found"

And this info on hover:

⚡ Cursor Usage Stats ⚠️ Error State

⚠️ Could not retrieve Cursor token from database---

pcarielo avatar May 24 '25 07:05 pcarielo

Can you share the diagnostic report (command pallete > diagnostic report)

Dwtexe avatar May 24 '25 08:05 Dwtexe

I'm experiencing the same issue here. In my case, here's my diagnostic report.

{
  "timestamp": "2025-05-24T08:20:06.811Z",
  "extensionVersion": "1.1.2",
  "os": "darwin 24.4.0",
  "vsCodeVersion": "1.96.2",
  "cursorStats": null,
  "usageLimitResponse": null,
  "premiumUsage": null,
  "teamInfo": null,
  "teamUsage": null,
  "rawResponses": {},
  "logs": [],
  "errors": {
    "token": "Failed to retrieve token from database"
  }
}

```Hope this helps with debugging the issue!

pstanton237 avatar May 24 '25 08:05 pstanton237

Can you check the logs? (output >cursor stats)

Dwtexe avatar May 24 '25 08:05 Dwtexe

@pstanton237 @pcarielo

Dwtexe avatar May 24 '25 08:05 Dwtexe

also can you check how big is your state.vscdb file

Dwtexe avatar May 24 '25 08:05 Dwtexe

Can you check the logs? (output >cursor stats)

The Cursor Stat output console is visible and accessible, but there are no logs displayed in it.

Image

pstanton237 avatar May 24 '25 08:05 pstanton237

also can you check how big is your state.vscdb file

My state.vscdb file is 167MB. :)

pstanton237 avatar May 24 '25 08:05 pstanton237

I am adding some logs to the code so we can understand what is going on there I will give you the test build in 5m

Dwtexe avatar May 24 '25 08:05 Dwtexe

I am adding some logs to the code so we can understand what is going on there I will give you the test build in 5m

Sure, I can help with that.

pstanton237 avatar May 24 '25 08:05 pstanton237

Oh wait, I've enabled debug logging and I can see errors in the output. Please hold on a moment.

pstanton237 avatar May 24 '25 08:05 pstanton237

Here are the logs from the output:

[2025-05-24T08:57:10.746Z] [INFO] [Command] Manually refreshing stats...
[2025-05-24T08:57:10.747Z] [INFO] [Stats] ====================================================================================================
[2025-05-24T08:57:10.747Z] [INFO] [Stats] Starting stats update...
[2025-05-24T08:57:10.747Z] [INFO] [Database] Attempting to open database at: /Users/pstanton237/Library/Application Support/Cursor/User/globalStorage/state.vscdb
[2025-05-24T08:57:10.749Z] [INFO] [Database] Error with database operation: SQLite3Error: unable to open database file true
[2025-05-24T08:57:10.750Z] [INFO] [Database] Database error details: {"message":"unable to open database file","stack":"SQLite3Error: unable to open database file\n\tat Database._handleError (/Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5956)\n\tat new Statement (/Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:6076)\n\tat Database.prepare (/Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5368)\n\tat Database._query (/Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5694)\n\tat Database.get (/Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5614)\n\tat getCursorTokenFromDB (/Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/out/services/database.js:46:24)\n\tat updateStats (/Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/out/utils/updateStats.js:19:65)\n\tat /Users/pstanton237/.cursor/extensions/dwtexe.cursor-stats-1.1.2/out/extension.js:95:49\n\tat mK.h (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:135:33048)\n\tat mK.$executeContributedCommand (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:135:33898)\n\tat det.S (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:116266)\n\tat det.Q (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:116046)\n\tat det.M (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:115134)\n\tat det.L (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:114239)\n\tat h2.value (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:113033)\n\tat C.B (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2391)\n\tat C.fire (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2609)\n\tat eo.fire (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:9489)\n\tat h2.value (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:195:13392)\n\tat C.B (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2391)\n\tat C.fire (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2609)\n\tat eo.fire (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:9489)\n\tat MessagePortMain.<anonymous> (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:195:11677)\n\tat MessagePortMain.emit (node:events:518:28)\n\tat MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2949)\n\tat Object.callbackTrampoline (node:internal/async_hooks:130:17)"} true
[2025-05-24T08:57:10.751Z] [INFO] [Critical] No valid token found true
[2025-05-24T08:57:10.751Z] [INFO] [Status Bar] Updated status bar with no token message
[2025-05-24T08:57:10.752Z] [INFO] [Status Bar] Status bar visibility updated after no token

pstanton237 avatar May 24 '25 08:05 pstanton237

To be clear, the state.vscdb file mentioned in the logs does actually exist.

$ ls -al "/Users/pstanton237/Library/Application Support/Cursor/User/globalStorage/state.vscdb"
-rw-r--r--@ 1 pstanton237  staff  175030272 May 24 17:56 /Users/pstanton237/Library/Application Support/Cursor/User/globalStorage/state.vscdb

pstanton237 avatar May 24 '25 09:05 pstanton237

ls -ald "/Users/pstanton237/Library/Application Support/Cursor/User/globalStorage/"

can you run this

Dwtexe avatar May 24 '25 09:05 Dwtexe

Sure, here's the output.

drwxr-xr-x@ 10 pstanton237  staff        320 May 24 17:57 .
drwxr-xr-x@ 11 pstanton237  staff        352 May 24 17:54 ..
drwxr-xr-x@  2 pstanton237  staff         64 Mar 15 01:00 mgtrrz.terraform-completer
drwxr-xr-x@  3 pstanton237  staff         96 Nov 26 15:24 ms-python.python
-rw-r--r--@  1 pstanton237  staff  175030272 May 24 18:04 state.vscdb
-rw-r--r--@  1 pstanton237  staff      32768 May 24 17:56 state.vscdb-shm
-rw-r--r--@  1 pstanton237  staff    4148872 May 24 18:07 state.vscdb-wal
-rw-r--r--@  1 pstanton237  staff  175030272 May 24 17:56 state.vscdb.backup
-rw-r--r--@  1 pstanton237  staff      92695 May 24 17:57 storage.json
drwxr-xr-x@ 12 pstanton237  staff        384 Mar 16 00:30 tamasfe.even-better-toml

pstanton237 avatar May 24 '25 09:05 pstanton237

Also, I wanted to mention that it works fine with version 1.1.1

pstanton237 avatar May 24 '25 09:05 pstanton237

yes I changed the sqlite libs because the old one couldnt handle the 2gb+ state.vscdb files

Dwtexe avatar May 24 '25 09:05 Dwtexe

I'll be away for a while - no rush, but feel free to drop any info when convenient and I'll respond when I'm back

pstanton237 avatar May 24 '25 09:05 pstanton237

I will not be at the computer for a while, unfortunately, I hope to solve the problem during the day.

Dwtexe avatar May 24 '25 09:05 Dwtexe

I'm experiencing the same issue

jonathanfan-ee avatar May 25 '25 05:05 jonathanfan-ee

Heyo, getting the same issue, not sure if its because of the extension update or cursor update(just updated from 50.4 to 50.7 on linux), logs:

[2025-05-26T07:49:58.817Z] [INFO] [Command] Manually refreshing stats...
[2025-05-26T07:49:58.817Z] [INFO] [Stats] ====================================================================================================
[2025-05-26T07:49:58.817Z] [INFO] [Stats] Starting stats update...
[2025-05-26T07:49:58.817Z] [INFO] [Database] Attempting to open database at: /home/thatmike1/.config/Cursor/User/globalStorage/state.vscdb
[2025-05-26T07:49:58.818Z] [INFO] [Database] Error with database operation: SQLite3Error: unable to open database file true
[2025-05-26T07:49:58.818Z] [INFO] [Database] Database error details: {"message":"unable to open database file","stack":"SQLite3Error: unable to open database file\n\tat Database._handleError (/home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5956)\n\tat new Statement (/home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:6076)\n\tat Database.prepare (/home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5368)\n\tat Database._query (/home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5694)\n\tat Database.get (/home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/node_modules/node-sqlite3-wasm/dist/node-sqlite3-wasm.js:7:5614)\n\tat getCursorTokenFromDB (/home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/out/services/database.js:46:24)\n\tat updateStats (/home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/out/utils/updateStats.js:19:65)\n\tat /home/thatmike1/.cursor/extensions/dwtexe.cursor-stats-1.1.2/out/extension.js:95:49\n\tat mK.h (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:135:33048)\n\tat mK.$executeContributedCommand (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:135:33898)\n\tat det.S (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:116266)\n\tat det.Q (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:116046)\n\tat det.M (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:115134)\n\tat det.L (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:114239)\n\tat h2.value (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:113033)\n\tat C.B (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2391)\n\tat C.fire (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2609)\n\tat eo.fire (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:9489)\n\tat h2.value (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:195:13392)\n\tat C.B (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2391)\n\tat C.fire (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2609)\n\tat eo.fire (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:44:9489)\n\tat MessagePortMain.<anonymous> (file:///tmp/.mount_cursororrpEL/usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:195:11677)\n\tat MessagePortMain.emit (node:events:518:28)\n\tat MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2949)"} true
[2025-05-26T07:49:58.819Z] [INFO] [Critical] No valid token found true
[2025-05-26T07:49:58.819Z] [INFO] [Status Bar] Updated status bar with no token message
[2025-05-26T07:49:58.820Z] [INFO] [Status Bar] Status bar visibility updated after no token

thatmike1 avatar May 26 '25 07:05 thatmike1