RPC Agent Polling Timeout (5000ms) β€” Even with Fresh RetoolRPC Setup

I'm getting the following error when trying to run the Retool RPC agent:

Error running RPC agent Error: Polling timeout after 5000ms
    at RetoolAPI.popQuery (file:///C:/Users/Raul%20Gonzalez/RetoolRPC/node_modules/retoolrpc/dist/rpc-f78d3d6d.mjs:314:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async RetoolRPC.fetchQueryAndExecute (file:///C:/Users/Raul%20Gonzalez/RetoolRPC/node_modules/retoolrpc/dist/rpc-f78d3d6d.mjs:471:35)
    at async loopWithBackoff (file:///C:/Users/Raul%20Gonzalez/RetoolRPC/node_modules/retoolrpc/dist/rpc-f78d3d6d.mjs:229:28)

I was already experiencing this issue in my previous project, so I decided to start fresh. I followed the documentation exactly and used Retool’s default server.js setup, but the error still happens immediately after starting the RPC agent.

Default setup .js:


const rpc = new RetoolRPC({
  apiToken: 'redacted for privacy',
  host: 'https://lynxphx.retool.com',
  resourceId: 'redacted for privacy',
  environmentName: 'production',
  pollingIntervalMs: 1000,
  version: '0.0.1', // optional version number for functions schemas
  logLevel: 'info', // use 'debug' for more verbose logging
})

rpc.register({
  name: 'helloWorld',
  arguments: {
    name: { type: 'string', description: 'Your name', required: true },
  },
  implementation: async (args, context) => {
    return {
      message: `Hello ${args.name}`,
      context,
    }
  },
})

rpc.listen()

This makes me think the issue isn’t related to my codebase. Is something broken with the default polling behavior or the RPC connection itself?

Any advice or things I should double-check?

Thanks for reaching out, @JasperCreationss. :slightly_smiling_face: To start, are you on a Cloud or self-hosted instance? The process for configuring the RPC server for each varies a bit, with the biggest difference being the need to set up a Redis resource if you are self-hosting.

On a Cloud instance, though, the setup process should be fairly straightforward. I just ran through the documented instructions and was able to successfully connect, but it's possible that you might be running into some network issues.

Is it possible that a firewall or something similar is preventing the agent from contacting Retool?

I think that might be it... our firewall is probably preventing the connection at times. I am currently looking into this and to allow the IP addresses. Hoping this solves this issue.

1 Like

Let me know when you've had a chance to look into potential networking issues and we can take it from there!