appsmithorg/appsmith · error · AppsmithPluginException
PE-ARG-5000
PE-ARG-5000
Error message
Cannot read spreadsheet URL. Please verify that the provided the Spreadsheet URL matches this pattern https://docs.google.com/spreadsheets/d/spreadsheetId_should_be_here/.
What it means
Thrown by MethodConfig.setSpreadsheetUrlFromSpreadsheetId (MethodConfig.java:95) when the supplied spreadsheet URL does not match the regex `https://docs.google.com/spreadsheets/d/([^/]+)/?.*`. The matcher's `find()` returns false, so no id group can be captured. Code PE-ARG-5000 (SPREADSHEET_ID_NOT_FOUND_IN_URL_ERROR_MSG).
Source
Thrown at app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/MethodConfig.java:95
formData, FieldName.WHERE, new TypeReference<Map<String, Object>>() {}, new HashMap<>());
this.whereConditions = parseWhereClause(whereForm);
}
this.projection = getDataValueSafelyFromFormData(formData, FieldName.PROJECTION, new TypeReference<>() {});
// Always add rowIndex to a valid projection
if (this.projection != null && !this.projection.isEmpty()) {
this.projection.add("rowIndex");
}
this.sortBy = getDataValueSafelyFromFormData(formData, FieldName.SORT_BY, new TypeReference<>() {});
this.paginateBy = getDataValueSafelyFromFormData(formData, FieldName.PAGINATION, new TypeReference<>() {});
}
private void setSpreadsheetUrlFromSpreadsheetId() {
final Matcher matcher = sheetRangePattern.matcher(spreadsheetUrl);
if (matcher.find()) {
this.spreadsheetId = matcher.group(1);
} else {
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
ErrorMessages.SPREADSHEET_ID_NOT_FOUND_IN_URL_ERROR_MSG);
}
}
public MethodConfig(TriggerRequestDTO triggerRequestDTO) {
final Map<String, Object> parameters = triggerRequestDTO.getParameters();
switch (parameters.size()) {
case 4:
this.queryFormat = getValueSafelyFromFormDataAsString(parameters, QUERY_FORMAT);
case 3:
case 2:
this.tableHeaderIndex = getValueSafelyFromFormDataAsString(parameters, TABLE_HEADER_INDEX);
this.sheetName = getValueSafelyFromFormDataAsString(parameters, SHEET_NAME);
case 1:
this.spreadsheetUrl = getValueSafelyFromFormDataAsString(parameters, SHEET_URL);
setSpreadsheetUrlFromSpreadsheetId();
}View on GitHub (pinned to 8cd9021c24)
Solutions
- Use the canonical form: `https://docs.google.com/spreadsheets/d/<id>/edit`.
- Resolve shortened/redirect links in a browser first and copy the final URL from the address bar.
- Ensure the scheme is exactly `https://` (not `http://`) and the host is `docs.google.com`.
- Strip surrounding quotes/whitespace from the bound value before submission.
Example fix
// before
{
"sheetUrl": "https://goo.gl/abcd"
}
// after
{
"sheetUrl": "https://docs.google.com/spreadsheets/d/1Bx...0Xc/edit#gid=0"
} Defensive patterns
Strategy: validation
Validate before calling
// Mirror the plugin regex client-side to catch bad URLs early.
const SHEET_URL_RE = /^https:\/\/docs\.google\.com\/spreadsheets\/d\//;
function normalizeSheetUrl(url) {
const s = String(url == null ? "" : url).trim();
return SHEET_URL_RE.test(s) ? s : ""; // empty => block submit
} Type guard
function looksLikeSheetUrl(v) {
return typeof v === "string" && /^https:\/\/docs\.google\.com\/spreadsheets\/d\/[\w-]+/.test(v.trim());
} Try / catch
if (action.error && action.error.message.includes("Cannot read spreadsheet URL")) {
showToast("Use a URL like https://docs.google.com/spreadsheets/d/<id>/edit", "error");
} Prevention
- Always paste the canonical URL from the browser address bar.
- Resolve shortened share links first.
- Strip whitespace/quotes and require the https:// scheme.
- Avoid legacy ccc?key= URLs; use the /d/<id>/ form.
When it happens
Trigger: Any action whose Spreadsheet URL field contains a string that does not start with the literal `https://docs.google.com/spreadsheets/d/<something>/`. Examples: `http://` (wrong scheme), a mobile/share short link, a URL with extra subdomain, a bare id, or a docs.google.com/spreadsheet (singular) link.
Common situations: Pasting a `https://goo.gl/...` short link (unresolved); using `http://` instead of `https://`; an old `docs.google.com/spreadsheet/ccc?key=` legacy URL; a bare id `1AbC...xyz` without the path prefix; extra leading whitespace or quotes around the URL; a typo like `docs.google.com/spreadsheetsd/`.
Related errors
AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12).
Data as JSON: /api/errors/3978dbb464c6da3e.
Report an issue: GitHub.