Google Drive Sheets connector can read spreadsheet but cannot write after plugin reinstall; shared read quota also returns 429

Open 💬 15 comments Opened May 24, 2026 by mikelottridge
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

In Codex Desktop, the Google Drive / Google Sheets connector can read an existing Google Sheet, but attempting to append a row with _batch_update_spreadsheet fails with a missing-permissions/scopes error. Reinstalling the Google Drive plugin did not resolve the write failure.

The same workflow also intermittently hit a shared Google Sheets API project read quota (ReadRequestsPerMinutePerProject) even though the user was not making other requests. That makes the connector feel unusable for a simple read-one-header/write-one-row task.

Environment

  • Product: Codex Desktop
  • Platform: Windows
  • Plugin/connector: google-drive@openai-curated
  • Tool family: Google Drive connector, Google Sheets tools
  • Date observed: 2026-05-24

Repro steps

  1. In a Codex Desktop session, use the Google Drive / Google Sheets connector against an existing Google Sheets spreadsheet.
  2. Call _get_spreadsheet_metadata for the spreadsheet.
  3. Call _get_spreadsheet_cells for a small bounded range (Sheet1!A1:M20) to read the header row.
  4. Prepare one row of current weather data from AccuWeather that matches the sheet headers.
  5. Attempt to append the row with _batch_update_spreadsheet using appendCells.
  6. Reinstall the Google Drive plugin and retry the same write.

Observed behavior

A metadata/cell read can succeed and confirm the spreadsheet, tab, sheetId, and headers. In this run the connector read the sheet title and Sheet1 metadata, then read headers such as:

Date, Time, Service, Temperature, Feels Like, Humidity, Wind Speed, Wind Direction, Precipitation, Cloud Cover, Pressure, UV Index, Visibility

But the write call fails:

Current action failed because this app connection is missing permissions or scopes required for this action. Reauthenticate to grant the missing access; other actions on this app may still work.

After the user reinstalled the Google Drive plugin, the same _batch_update_spreadsheet append still failed with the same missing-permissions/scopes message.

Separately, narrow read calls intermittently failed with a project-level Google Sheets API quota error:

Error code: RATE_LIMITED; Error: HTTPError: 429: Too Many Requests
Quota exceeded for quota metric 'Read requests' and limit 'Read requests per minute' of service 'sheets.googleapis.com' for consumer 'project_number:77377267392'.
quota_limit: ReadRequestsPerMinutePerProject
quota_limit_value: 300
quota_unit: 1/min/{project}

The user was not making other Google Sheets requests, so this appears to be a shared connector/backend project quota rather than user-specific activity.

Expected behavior

For an installed Google Drive / Google Sheets connector, Codex should be able to complete a simple read-header + append-row workflow, or it should clearly surface an actionable auth upgrade path before the agent reaches the write step.

At minimum:

  • The connector install/reinstall flow should request or preserve the scopes required for exposed write tools such as _batch_update_spreadsheet.
  • If the connection lacks write scopes, the app should expose a direct reauthorize/upgrade flow for the Google Drive connector from the failed action.
  • The connector should not expose write tools that are unusable with the current auth state without a clear remediation path.
  • Project-level read quota exhaustion should be handled or messaged as a shared backend quota issue, not as if the user caused excessive requests.

Impact

The user asked Codex to write one line of AccuWeather data into a Google Sheet. Codex could inspect the sheet and build the exact row, but could not write it even after the user reinstalled the Google Drive plugin. The task could not be completed through the connector.

View original on GitHub ↗

15 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #24233

Powered by Codex Action

jshaofa-ui · 1 month ago

Solution Proposal: Google Drive Sheets Connector Write Failure Fix

Problem Analysis

The Google Drive/Sheets connector can read but cannot write. The connector install flow does not request or preserve scopes required for write tools like _batch_update_spreadsheet. Additionally, shared project-level quota errors are not handled gracefully.

Proposed Fix

  1. Scope Declaration: Add scope declaration to connector manifest (read-only vs full scope per tool)
  2. Inline Reauthorization: Trigger inline OAuth reauthorization when write scope is missing (no reinstall needed)
  3. Quota Error Handling: Detect ReadRequestsPerMinutePerProject errors and surface actionable messages with retry-after guidance

Code Structure

class GoogleSheetsConnector:
    REQUIRED_SCOPES = {
        "_get_spreadsheet_cells": ["spreadsheets.readonly"],
        "_batch_update_spreadsheet": ["spreadsheets"],  # Full scope
    }
    
    def execute_tool(self, tool_name, params):
        required = self.REQUIRED_SCOPES.get(tool_name, [])
        if not self.auth_manager.has_scopes(required):
            return self.auth_manager.upgrade_scopes(required)
        return self._execute(tool_name, params)

Timeline: 4 days

Pricing: $2,000 - $3,000

We have deep MCP integration and OAuth expertise from production deployment of 25+ Lark API Skills.

jshaofa-ui · 1 month ago

Issue Summary

Title: Google Drive Sheets connector can read spreadsheet but cannot write after plugin reinstall; shared read quota also returns 429
Labels: bug, windows-os, auth
Competition: 2 comments (low competition)
Priority: 🟠 High — breaks write operations for Sheets users

Root Cause Analysis

After reinstalling the Google Drive plugin, the Sheets connector can READ spreadsheets but cannot WRITE to them. Additionally, shared read quota returns 429 (rate limit) errors.

Likely Causes

  1. Incomplete credential migration: The plugin reinstall may have created new OAuth credentials but didn't migrate the write-scoped tokens. Read access works with a broader scope, but write operations require specific scopes that weren't re-granted.
  1. Token scope mismatch: The new OAuth token may have https://www.googleapis.com/auth/spreadsheets.readonly but not https://www.googleapis.com/auth/spreadsheets.
  1. Plugin state not fully reset: The reinstall may have left stale state that conflicts with the new installation.
  1. Rate limit configuration: The 429 errors suggest the plugin's rate limiting configuration was reset or is misconfigured after reinstall.

Proposed Fix

Fix 1: Credential Migration on Plugin Install (Primary)

// In google-drive-plugin.ts — handle credential migration
async function onPluginInstall(config: PluginConfig): Promise<void> {
  // Check for existing credentials from previous installation
  const existingCredentials = await this.migrationStore.get('google_drive_credentials');
  
  if (existingCredentials) {
    // Migrate existing credentials to new installation
    await this.credentialStore.set('oauth_token', existingCredentials.token);
    await this.credentialStore.set('refresh_token', existingCredentials.refresh_token);
    await this.credentialStore.set('scopes', existingCredentials.scopes);
    
    // Verify the migrated credentials have write scope
    const hasWriteScope = existingCredentials.scopes.includes(
      'https://www.googleapis.com/auth/spreadsheets'
    );
    
    if (!hasWriteScope) {
      // Request additional write scope
      await this.requestAdditionalScopes([
        'https://www.googleapis.com/auth/spreadsheets',
      ]);
    }
  } else {
    // Fresh install — request full scopes
    await this.requestScopes([
      'https://www.googleapis.com/auth/spreadsheets',
      'https://www.googleapis.com/auth/drive.file',
    ]);
  }
}

Fix 2: Scope Verification Before Write Operations

// In google-drive-plugin.ts — verify write scope before operations
async function writeSheet(
  spreadsheetId: string,
  range: string,
  values: any[][]
): Promise<void> {
  const token = await this.credentialStore.get('oauth_token');
  
  // Verify the token has write scope
  const tokenInfo = await this.verifyTokenScopes(token);
  
  if (!tokenInfo.scopes.includes('https://www.googleapis.com/auth/spreadsheets')) {
    // Token doesn't have write scope — trigger re-auth
    throw new PluginAuthError(
      'Write access not granted. Please re-authorize the plugin ' +
      'with write permissions for Google Sheets.',
      { action: 'reauthorize', requiredScopes: ['spreadsheets'] }
    );
  }
  
  // Proceed with write operation
  await this.sheetsApi.values.update({
    spreadsheetId,
    range,
    valueInputOption: 'USER_ENTERED',
    resource: { values },
  });
}

Fix 3: Rate Limit Configuration

// In google-drive-plugin.ts — configure rate limiting
class GoogleDrivePlugin {
  private rateLimiter: RateLimiter;
  
  constructor() {
    this.rateLimiter = new RateLimiter({
      // Google Sheets API limits: 300 requests per 100 seconds per project
      // Per-user: 60 requests per 100 seconds
      maxRequests: 50,
      windowMs: 100 * 1000,
      onRateLimit: async () => {
        this.logger.warn('Rate limit approaching, backing off');
        await this.rateLimiter.backoff(5000);
      },
    });
  }
  
  async readSheet(spreadsheetId: string, range: string): Promise<any[][]> {
    await this.rateLimiter.acquire();
    try {
      return await this.sheetsApi.values.get({ spreadsheetId, range });
    } finally {
      this.rateLimiter.release();
    }
  }
}

Testing Methodology

  1. Reproduce the issue:
  • Install Google Drive plugin
  • Reinstall the plugin
  • Try to read a spreadsheet (should work)
  • Try to write to a spreadsheet (should fail)
  1. Verify fix:
  • Apply the fix
  • Repeat the same steps
  • Verify: Both read and write work after reinstall
  1. Edge cases:
  • Plugin uninstall + reinstall
  • Multiple Google accounts
  • Shared spreadsheets with different permission levels

Impact Assessment

  • User Impact: High — breaks write operations for Sheets users
  • Severity: Data integrity — can't save changes to spreadsheets
  • Risk of Fix: Low — adding credential migration logic
  • Estimated Effort: 2-3 hours

Competitive Advantage

  • Low competition (2 comments, but no solutions)
  • Windows-specific + auth area
  • Clear root cause (credential migration gap)
  • Affects productivity workflows
H0rs3man · 1 month ago

Hi, experiencing the same issue here, I wonder if you fixed it successfully?

ponugoti · 1 month ago

Same issue, wasted so many credits trying to fix it through codex :(

C-Advait · 1 month ago

Same issue. Connector is read-only access.
Computer details: MacOs 15.7.4 (24G517)
Codex: Version 26.519.41501 (3044)
Google Drive connector installed 11:48 PM UTC time

Error message states:

Current action failed because this app connection is missing permissions or scopes required for this action. Reauthenticate to grant the missing access; other actions on this app may still work.
CyberMZ666 · 1 month ago

experience same issue here. Any updates on the fix?

C-Advait · 1 month ago

@CyberMZ666 @ponugoti @H0rs3man @jshaofa-ui

Fix that worked for me:

  1. Install codex cli
  2. launch cli, run /plugins and type "gmail"
  3. install the gmail plugin via cli, authenticate
  4. Restart codex cli, using @gmail have it check your email and attempt to read the top email (or some sort of similar request). Ask what inbox user it is authenticated for and reading from.
  5. Quit codex app and re-open
  6. /gmail or @gmail command should now work. Ask the same command as in 4 to verify.

Hope this helps!

ponugoti · 1 month ago

@C-Advait the problem isn't the Gmail plugin, it's the Google Sheets/Drive plugin's write access. Gmail has been working fine.

culli · 1 month ago
@CyberMZ666 @ponugoti @H0rs3man @jshaofa-ui Fix that worked for me: 1. Install codex cli 2. launch cli, run /plugins and type "gmail" 3. install the gmail plugin via cli, authenticate 4. Restart codex cli, using @gmail have it check your email and attempt to read the top email (or some sort of similar request). Ask what inbox user it is authenticated for and reading from. 5. Quit codex app and re-open 6. /gmail or @gmail command should now work. Ask the same command as in 4 to verify. Hope this helps!

This didn't work for me. I tried (replacing "gmail" with "sheets") reinstalling the Google Drive plugin via codex CLI and that could not write to a google sheet either.

The connector can read the workbook metadata but failed on the write because its current Google Drive connection is missing the Sheets edit scope. I’m going to try the UI path next, using the browser session if it’s already authenticated.

(then it goes off and tries to do the update via Computer Use, which is also not what I was looking for).

smeetChheda · 1 month ago

The only solution I found was to go to my account settings in ChatGPT web and go to Apps -> Google Drive and then hit Disconnect and subsequently 'Connect'. Hope this helps

RTnhN · 1 month ago

Smeet's solution also worked for me. I had to go online in the ChatGPT website to do it. You can't fix these permissions through the codex app or CLI.

H0rs3man · 1 month ago

We have a solution from @reduced2as
Link: https://github.com/openai/codex/issues/24233

mikelottridge · 1 month ago

I tried this workaround on Codex Desktop for Windows and can confirm it worked, with one extra caveat: I had to restart Codex after completing the OAuth flow.

What I did:

  1. First I verified the failure from Codex itself by asking the Google Drive connector to create a native Google Doc. It failed with:

Current action failed because this app connection is missing permissions or scopes required for this action. Reauthenticate to grant the missing access; other actions on this app may still work.

  1. In ChatGPT Web, I went to Settings -> Apps -> Google Drive and disconnected Google Drive.
  1. I reconnected Google Drive from the ChatGPT app directory. As described above, the first Google OAuth prompt still only requested read-style access for Drive/Docs/Sheets/Slides. I selected all requested permissions and completed that flow anyway.
  1. Then I opened a brand-new ChatGPT Web chat and prompted:

Create a Google Doc named "Codex Drive Write Scope Trigger Test" with the content "test".

  1. ChatGPT showed a “Reconnect Google Drive” prompt. I clicked Reconnect, went through Google OAuth again, and this time Google requested the missing write scopes, including permissions to see/edit/create/delete Drive files and Docs/Sheets/Slides content.
  1. After approving those scopes, ChatGPT Web successfully created and edited the test Google Doc.

Issue encountered:

After completing the browser-side OAuth flow, my existing Codex Desktop session did not immediately pick up the refreshed connector state. Instead of the original missing-scope error, Google Drive tool calls started returning:

Unknown tool: google drive_create_file

Workaround:

I restarted Codex Desktop. After restart, the Google Drive connector worked from Codex. I verified this by:

  • Creating a new Google Doc through the Codex Google Drive connector.
  • Inserting text into that doc with a Docs batch update.
  • Reading the document text back through the connector.

So the workaround fixed the OAuth scope problem, but Codex may need to be restarted or a fresh session started before the updated connector/tool state is usable.

Codex / Windows actually was able to do the fix for me... i summarized the steps done as a prompt if anyone wants to try it:
==================
Please apply and verify the Google Drive write-scope workaround from openai/codex issue #24233.

Goal:
Fix the Codex Desktop Google Drive connector so it can create and edit Google Docs, not just read Drive files.

Steps:

  1. First, verify the current failure from Codex:
  • Use the Google Drive connector to create a native Google Doc titled:

Codex Drive Write Scope Baseline Test

  • If it succeeds, continue to edit/readback verification.
  • If it fails with a missing permissions/scopes error, continue.
  1. Use Chrome with my logged-in ChatGPT session to perform the workaround:
  • Open ChatGPT Web.
  • Go to Settings -> Apps -> Google Drive.
  • Disconnect Google Drive if it is connected.
  • Reconnect Google Drive from the ChatGPT app directory.
  • Complete the first Google OAuth flow, selecting all requested permissions.
  • Open a brand-new ChatGPT chat.
  • Send this prompt:

Create a Google Doc named "Codex Drive Write Scope Trigger Test" with the content "test".

  • If ChatGPT shows a “Reconnect Google Drive” prompt, click it.
  • Complete the second Google OAuth flow.
  • IMPORTANT: If Google asks for write/edit/create/delete permissions for Drive, Docs, Sheets, or Slides, select all requested permissions and continue.
  • If password, 2FA, CAPTCHA, or an account-choice uncertainty appears, stop and ask me to complete it.
  1. Approve the ChatGPT Web tool confirmations only for the test document:
  • Create File
  • Edit Document
  1. Return to Codex and verify:
  • Try creating a new Google Doc titled:

Codex Drive Write Scope Test After OAuth

  • Insert this text into it:

Codex Google Drive write verification passed.

  • Read the document text back through the Google Drive connector.
  • Report the created document URL and the exact readback text.
  1. If Codex Google Drive tools return Unknown tool or look stale after OAuth:
  • Tell me the browser-side OAuth succeeded.
  • Ask me to restart Codex Desktop.
  • After restart, retry the create/edit/readback verification.

Do not claim success unless the final Codex connector readback confirms the inserted text.

jacob-israel-turner · 1 month ago

Fixed by reconnecting.

Plugins -> Google Drive -> "Connected" dropdown -> reconnect. This will take you to ChatGPT, where you can reconnect the Drive connection. Fixed the 429 error for me!