encore
encore copied to clipboard
Run fails with `An existing connection was forcibly closed by the remote host`
Platform: Windows 11 Docker: WSL Terminal: Powershell
After initializing I run
encore run
⠒ Building Encore application graph...
⠂ Analyzing service topology...
⠙ Starting Encore application...
Encore development server running!
Your API is running at: http://127.0.0.1:4000
Development Dashboard URL: http://localhost:9400/gm6q8
10:58PM FTL connection failure error="rpc error: code = Unavailable desc = error reading from server: read unix @->C:\\Users\\alpap\\AppData\\Local\\encore\\encored.sock: wsarecv: An existing connection was forcibly closed by the remote host."
Which version of Encore are you running? Is this still happening on v1.41.11 (just released)?
I am facing the same issue, fresh install and trying to run hello world. The same setup (Windows 11, Docker WSL, Powershell) encore version v1.44.9
Same issue with encore version v1.45.2 running on W11.
UPDATE: Temporary workaround after many trials and errors:
- enter your default WSL (preferably a Debian one but it's up to you)
- install encore cli
- install node via your preferred method (cof cof, NVM, cof cof)
- ensure the WSL proxies all docker requests to the Windows host (a simple check that the same images exist on the host and in the WSL is enough)
- run
encore runas always, it should work, notice that the dependencies (npm ones) will result in corruption if you're writing from your code from Windows.
There are definitely some compatibility problems with Windows hosts.
For dev reference, the problem resides in the daemon not being able to open some ports (even if they are available) the following is the log generated by the crash.
My cause to error like this one is:
interface DataPatchesResponse {
[id: string]: any;
}
const getDataPatchId = (type: string, id: string): string => {
return `${type}:${id}`;
}
export const getAll = api(
{ method: "GET", path: "/data-patch", expose: true },
async (): Promise<DataPatchesResponse> => {
const rows = await prisma.dataPatch.findMany();
const response = {} as DataPatchesResponse;
for (const row of rows) {
response[getDataPatchId(row.type, row.dataId)] = row.data;
}
return response;
},
);
It is because of DataPatchesResponse