{"record":{"id":"2d6ab25d07081d05","repo":"usebruno/bruno","slug":"method-path-not-found-please-refresh-the-metho","errorCode":null,"errorMessage":"Method ${path} not found, please refresh the methods","messagePattern":"Method (.+?) not found, please refresh the methods","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-requests/src/grpc/grpc-client.js","lineNumber":417,"sourceCode":"    };\n\n    if (proxyUrl.username) {\n      proxyChannelOptions['grpc.http_connect_creds']\n        = `${decodeURIComponent(proxyUrl.username)}:${decodeURIComponent(proxyUrl.password)}`;\n    }\n\n    const targetHost = `${proxyUrl.hostname}:${proxyUrl.port || 80}`;\n    return { targetHost, proxyChannelOptions };\n  }\n\n  /**\n   * Get method from the path\n   */\n  #getMethodFromPath(path) {\n    if (this.methods.has(path)) {\n      return this.methods.get(path);\n    }\n    throw new Error(`Method ${path} not found, please refresh the methods`);\n  }\n\n  /**\n   * Refresh methods using reflection or proto file as fallback\n   * @param {Object} options - Options for refreshing methods\n   * @param {string} options.url - The gRPC server URL\n   * @param {Object} options.headers - The request headers/metadata\n   * @param {string} [options.protoPath] - Path to proto file if available\n   * @param {string} [options.collectionPath] - Collection path for proto file resolution\n   * @param {string} [options.collectionUid] - Collection UID\n   * @param {Object} [options.certificates] - Certificate configuration\n   * @param {Object} [options.verifyOptions] - Additional options for verifying the server certificate\n   * @param {string[]} [options.includeDirs] - Include directories for proto file resolution\n   * @returns {Promise<boolean>} Whether methods were successfully refreshed\n   * @private\n   */\n  async #refreshMethods({ url, headers, protoPath, collectionPath, collectionUid, certificates = {}, verifyOptions, includeDirs = [], proxyConfig }) {\n    try {","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-requests/src/grpc/grpc-client.js#L399-L435","documentation":"Thrown by the private #getMethodFromPath when the requested gRPC method path is not in the client's in-memory methods map. The map is populated by reflection or proto-file loading; a miss means the method set is stale, the proto is outdated, or the path is wrong.","triggerScenarios":"Calling invoke with a path like '/pkg.Svc/Method' that was not present when refreshMethods ran — e.g. the server added a new method after reflection, the proto file changed, or the path string has a typo/different package prefix.","commonSituations":"Server deployed a new gRPC service version with renamed methods; the proto file loaded locally is out of date; reflection returned a partial list due to a transient error; path casing or package name mismatch.","solutions":["Call the client's refresh methods flow again (re-run reflection or reload the proto) and retry.","Verify the path string exactly matches package.Service/Method from the current proto, including casing and package prefix.","Confirm the gRPC server actually exposes the method (check server logs or grpcurl list).","If using a local proto, ensure it is the same version the server compiled against."],"exampleFix":"// before\nclient.invoke('/pkg.Svc/OldMethodName', { ... });  // renamed on server\n\n// after\nawait client.refreshMethods({ url, headers });       // re-discover\nclient.invoke('/pkg.Svc/NewMethodName', { ... });","handlingStrategy":"retry","validationCode":"// Pre-check: confirm the path is known before invoking\nconst knownPaths = await client.listMethods();  // or maintain a cached set\nif (!knownPaths.includes(path)) throw new Error(`Unknown method ${path}; refresh methods first`);","typeGuard":"function isKnownMethod(client, path) { return client.methods && client.methods.has(path); }","tryCatchPattern":"async function invokeWithRefresh(client, path, req, opts) {\n  try { return await client.invoke(path, req, opts); }\n  catch (e) {\n    if (e.message.includes('not found, please refresh the methods')) {\n      await client.refreshMethods(opts);            // re-discover\n      return client.invoke(path, req, opts);         // retry once\n    }\n    throw e;\n  }\n}","preventionTips":["Call refreshMethods after the server is deployed or the proto changes.","Verify the path string against the current proto (package.Service/Method, exact case).","Cache the method list and check membership before invoking to avoid the throw entirely.","On transient reflection failures, retry refresh before giving up."],"tags":["grpc","stale-state","configuration","runtime"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}