Invalid Protocol Version

Hey guys, I followed docs and made a counter actor, it works fine without a RIVET_ENGINE url but after I add one (using docker compose from self hosting documentation) it doesn't work anymore.
import { setup } from 'rivetkit';
import { counter } from '@/actors/counter';

export const registry = setup({
use: { counter },
});

export const { client } = registry.createServer();
import { setup } from 'rivetkit';
import { counter } from '@/actors/counter';

export const registry = setup({
use: { counter },
});

export const { client } = registry.createServer();
import { actor } from 'rivetkit';

export const counter = actor({
state: { count: 0 },
actions: {
increment: (c, amount: number = 1) => {
c.state.count += amount;
c.broadcast('countChanged', c.state.count);
return c.state.count;
},
getCount: c => c.state.count,
},
});
import { actor } from 'rivetkit';

export const counter = actor({
state: { count: 0 },
actions: {
increment: (c, amount: number = 1) => {
c.state.count += amount;
c.broadcast('countChanged', c.state.count);
return c.state.count;
},
getCount: c => c.state.count,
},
});
rivet-engine-1 | ts=2025-09-16T02:32:42.218761652Z level=warn message="parse url failed" addr=[::1]:35984 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:43.367110519Z level=warn message="parse url failed" addr=[::1]:35986 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:44.539822137Z level=warn message="parse url failed" addr=[::1]:35992 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:45.769081391Z level=warn message="parse url failed" addr=[::1]:36002 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:46.958473889Z level=warn message="parse url failed" addr=[::1]:36012 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:48.132075064Z level=warn message="parse url failed" addr=[::1]:36028 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:49.239247752Z level=warn message="parse url failed" addr=[::1]:36038 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:50.436608106Z level=warn message="parse url failed" addr=[::1]:36046 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:51.569077591Z level=warn message="parse url failed" addr=[::1]:52328 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:52.776094519Z level=warn message="parse url failed" addr=[::1]:52342 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:53.979240386Z level=warn message="parse url failed" addr=[::1]:52346 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:42.218761652Z level=warn message="parse url failed" addr=[::1]:35984 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:43.367110519Z level=warn message="parse url failed" addr=[::1]:35986 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:44.539822137Z level=warn message="parse url failed" addr=[::1]:35992 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:45.769081391Z level=warn message="parse url failed" addr=[::1]:36002 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:46.958473889Z level=warn message="parse url failed" addr=[::1]:36012 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:48.132075064Z level=warn message="parse url failed" addr=[::1]:36028 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:49.239247752Z level=warn message="parse url failed" addr=[::1]:36038 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:50.436608106Z level=warn message="parse url failed" addr=[::1]:36046 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:51.569077591Z level=warn message="parse url failed" addr=[::1]:52328 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:52.776094519Z level=warn message="parse url failed" addr=[::1]:52342 err="invalid protocol version"
rivet-engine-1 | ts=2025-09-16T02:32:53.979240386Z level=warn message="parse url failed" addr=[::1]:52346 err="invalid protocol version"
I'm wondering if this is a bug or if I'm setting something up incorrectly
12 Replies
wing
wingOP3mo ago
services:
postgres:
image: postgres:15
environment:
POSTGRES_DB: rivet
POSTGRES_USER: rivet
POSTGRES_PASSWORD: rivet_password
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped

rivet-engine:
image: rivetkit/engine:latest
ports:
- '6420:6420'
environment:
RIVET__POSTGRES__URL: postgresql://rivet:rivet_password@postgres:5432/rivet
depends_on:
- postgres
restart: unless-stopped

volumes:
postgres-data:
services:
postgres:
image: postgres:15
environment:
POSTGRES_DB: rivet
POSTGRES_USER: rivet
POSTGRES_PASSWORD: rivet_password
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped

rivet-engine:
image: rivetkit/engine:latest
ports:
- '6420:6420'
environment:
RIVET__POSTGRES__URL: postgresql://rivet:rivet_password@postgres:5432/rivet
depends_on:
- postgres
restart: unless-stopped

volumes:
postgres-data:
Nathan
Nathan3mo ago
Hey! GIve me a bit to check in to this -- I think we cut a release on RivetKit a bit too early.
wing
wingOP3mo ago
Thanks! In the mean time, is there a version I can switch to either in docker or in my package.json to avoid this error?
Nathan
Nathan3mo ago
Looks like our CI pipeline was publishing to the wrong Docker tag. I cut a release for RivetKit 2.0.4 and Rivet Engine 25.6.1. You should see the new rivetkit/engine on Docker Hub once this is finished: https://github.com/rivet-dev/engine/actions/runs/17762049684 Update to those versions and let me know how that works!
GitHub
release · rivet-dev/engine@5b7101b
Scale and orchestrate RivetKit. Contribute to rivet-dev/engine development by creating an account on GitHub.
wing
wingOP3mo ago
I updated to those versions, but now when my server restarts I can't access actors previously created It properly connects to the engine now though
{"group":"guard","code":"actor_ready_timeout","message":"Timed out waiting for actor to become ready. Ensure that the runner name selector is accurate and there are runners available in the namespace you created this actor.","metadata":{"actor_id":"5vakuhhhaxw0rwo1looo5qsvstcl00"}}
{"group":"guard","code":"actor_ready_timeout","message":"Timed out waiting for actor to become ready. Ensure that the runner name selector is accurate and there are runners available in the namespace you created this actor.","metadata":{"actor_id":"5vakuhhhaxw0rwo1looo5qsvstcl00"}}
Nathan
Nathan3mo ago
that's not right, what does your client script look like?
wing
wingOP3mo ago
import { registry } from '@/actors';

export const { client } = registry.createServer();
import { registry } from '@/actors';

export const { client } = registry.createServer();
import {
SlashCommandBuilder,
ChatInputCommandInteraction,
} from 'discord.js';

export const data = new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with pong');

export async function execute(
interaction: ChatInputCommandInteraction<'cached'>
) {
const { client } = await import('@/rivet');
const counter = client.counter.getOrCreate([
interaction.user.id,
]);

const count = await counter.increment();

await interaction.reply({
content: `pong ${count}`,
});
}
import {
SlashCommandBuilder,
ChatInputCommandInteraction,
} from 'discord.js';

export const data = new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with pong');

export async function execute(
interaction: ChatInputCommandInteraction<'cached'>
) {
const { client } = await import('@/rivet');
const counter = client.counter.getOrCreate([
interaction.user.id,
]);

const count = await counter.increment();

await interaction.reply({
content: `pong ${count}`,
});
}
I'm trying to use this in a discord bot
Nathan
Nathan3mo ago
Managed to reproduce this error. Will have a fix up asap tomorrow. Quick update – issue is fixed, cutting a release in a moment.
Nathan
Nathan3mo ago
This is fixed in Rivet Engine 25.7.0 and RivetKit 2.0.5. If this is a dev server, you'll need to delete the data dir. If you don't know where this is, search for "starting file system driver" in the logs after starting v25.7 of the engine. It seems this issue was because of corrupt state from an earlier version of Rivet Engine before upgrading it. This issue has been fixed and added a bunch of tests to make sure this type of thing can't happen again.
wing
wingOP3mo ago
Thanks! I’ll try it out later today Also, how would I go about trying this with foundation db instead of Postgres? And what would you recommend using
Nathan
Nathan3mo ago
FoundationDB is part of our enterprise version, since since we usually need to help companies set it up correctly. We're still working on updating our pricing page for this. Happy to chat if you think you're going down that route – otherwise we have our cloud very soon which provides a managed version running on FoundationDB.
wing
wingOP3mo ago
Oh I thought I read before that the version with foundation db was going to be self hostable, I might have read/remembered wrong

Did you find this page helpful?