volcanicislander
volcanicislander
Explore posts from servers
RRailway
Created by volcanicislander on 9/27/2024 in #✋|help
Cron job stuck running...
No description
32 replies
RRailway
Created by volcanicislander on 9/5/2024 in #✋|help
HTTP Logs Question
I have a service (web app) that I keep private and serve traffic to through Cloudflare Tunnel, also hosted as a railway service. I noticed the Web App doesn't have HTTP Logs on deploys, and doesn't have a setting to enable them. I figured it was because it was private and confirmed by generating a public domain which allowed me to see HTTP Logs on the deploy. My question is: is it possible to have HTTP Logs on a private service that is served through Cloudflare Tunnels (cloudflared)?
7 replies
RRailway
Created by volcanicislander on 8/8/2024 in #✋|help
Cron execution slightly delayed - normal?
I have a script which runs every 30 minutes via Railway's Cron support, in order to execute jobs at a specific time. The script contains multiple functions and determines which to run based on the time. I initially checked for the exact minute and hour i.e. 30th minute of 8th hour, but noticed that often the appropriate function would not execute because the actual execution of the container was after the 0th/30th minute. It seems to take some time from the start of the Cron trigger and the actual execution of the code, about 90 seconds. Example from Deploy Logs where container executes after 1:10 has passed: Current time: Wed, 07 Aug 2024 22:01:10 GMT Is this normal? Does it have to do with Railway building a fresh container for each cron execution? I have temporarily resolved the issue by giving the script's functions some wiggle room (~5min) but ideally if I want the script to run a certain function at 8:30, it should run at 8:30 or as close as possible.
10 replies
RRailway
Created by volcanicislander on 7/25/2024 in #✋|help
Private networking connection refused
I have a web application connected to an API using private networking. I seem to be receiving an error when trying to fetch.
TypeError: fetch failed

at fetch (/app/node_modules/undici/index.js:112:13)

at processTicksAndRejections (node:internal/process/task_queues:95:5)

at action$8 (file:///app/build/server/index.js?t=1721893528000:8308:22)

at Object.callRouteAction (/app/node_modules/@remix-run/server-runtime/dist/data.js:37:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:88:20

at callLoaderOrAction (/app/node_modules/@remix-run/router/router.ts:4881:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:83:20

at async Promise.all (index 1)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:81:19

at callDataStrategyImpl (/app/node_modules/@remix-run/router/router.ts:4722:17) {

[cause]: Error: connect ECONNREFUSED fd12:8122:4304::7f:7611:cb72:8000

at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16) {

errno: -111,

code: 'ECONNREFUSED',

syscall: 'connect',

address: 'fd12:8122:4304::7f:7611:cb72',

port: 8000

}

}
TypeError: fetch failed

at fetch (/app/node_modules/undici/index.js:112:13)

at processTicksAndRejections (node:internal/process/task_queues:95:5)

at action$8 (file:///app/build/server/index.js?t=1721893528000:8308:22)

at Object.callRouteAction (/app/node_modules/@remix-run/server-runtime/dist/data.js:37:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:88:20

at callLoaderOrAction (/app/node_modules/@remix-run/router/router.ts:4881:16)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:83:20

at async Promise.all (index 1)

at /app/node_modules/@remix-run/server-runtime/dist/single-fetch.js:81:19

at callDataStrategyImpl (/app/node_modules/@remix-run/router/router.ts:4722:17) {

[cause]: Error: connect ECONNREFUSED fd12:8122:4304::7f:7611:cb72:8000

at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16) {

errno: -111,

code: 'ECONNREFUSED',

syscall: 'connect',

address: 'fd12:8122:4304::7f:7611:cb72',

port: 8000

}

}
The API is listening on "[::1]:8000" and the URL passed to fetch looks good to me: http://my-api.railway.internal:8000/api/endpoint I didn't specify https per the docs.
8 replies
RRailway
Created by volcanicislander on 11/2/2023 in #✋|help
Billing - CC Declined
No description
7 replies
DTDrizzle Team
Created by volcanicislander on 10/4/2023 in #help
Inferred Types not picking up Relations
I'm having issues with my inferred types from the "Core Type API" not picking up relations. I am trying to model a 1-to-Many relationship between users and assignments . A user can "create many" assignments. My query looks like this:
await client(context.env.DB).query.assignmentsTable.findMany({
with: {
createdBy: true
},
});
await client(context.env.DB).query.assignmentsTable.findMany({
with: {
createdBy: true
},
});
And the involved tables and relations from my schema file are defined as:
export const assignmentsTable = sqliteTable("assignments", {
id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
position: text("position").notNull(),
// ...other columns
createdBy: integer("created_by")
.references(() => usersTable.id, { onDelete: "cascade" })
.notNull(),

export const assignmentsRelations = relations(
assignmentsTable,
({ one, many }) => ({
// 1 assignment is created by 1 user
createdBy: one(usersTable, {
fields: [assignmentsTable.createdBy],
references: [usersTable.id],
relationName: "assignments.created",
}),
}),
);

export const usersTable = sqliteTable("users", {
id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
userId: text("user_id").notNull(),
last: text("last").notNull(),
first: text("first").notNull(),
// ...other columns
});

export const usersRelations = relations(usersTable, ({ many }) => ({
assignmentsCreated: many(assignmentsTable, {
relationName: "assignments.created",
}),
// ...other relations
}));
export const assignmentsTable = sqliteTable("assignments", {
id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
position: text("position").notNull(),
// ...other columns
createdBy: integer("created_by")
.references(() => usersTable.id, { onDelete: "cascade" })
.notNull(),

export const assignmentsRelations = relations(
assignmentsTable,
({ one, many }) => ({
// 1 assignment is created by 1 user
createdBy: one(usersTable, {
fields: [assignmentsTable.createdBy],
references: [usersTable.id],
relationName: "assignments.created",
}),
}),
);

export const usersTable = sqliteTable("users", {
id: integer("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
userId: text("user_id").notNull(),
last: text("last").notNull(),
first: text("first").notNull(),
// ...other columns
});

export const usersRelations = relations(usersTable, ({ many }) => ({
assignmentsCreated: many(assignmentsTable, {
relationName: "assignments.created",
}),
// ...other relations
}));
My type is defined as:
export type Assignment = typeof assignmentsTable.$inferSelect;
export type Assignment = typeof assignmentsTable.$inferSelect;
The query properly retrieves the user under the createdBy column but the typing still thinks the createdBy column should be a number and not the embedded user from the relation. What am I missing here? For reference, this is in a Remix project using Cloudflare D1.
9 replies
RRailway
Created by volcanicislander on 10/3/2023 in #✋|help
Unable to connect to MSSQL container through TCP Proxy
I was able to build and run a SQL Server database through a Dockerfile, exposing the standard port and providing the proper build arguments but am unable to connect after setting up a TCP Proxy (since this is a Docker-based deployment and not a supported Database Service it doesn't have a connection string if I understand right). The error I first receive when trying to connect from SQL Server Management Studio is:
Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
I also receive the error:
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (Framework Microsoft SqlClient Data Provider)
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (Framework Microsoft SqlClient Data Provider)
Is this a TLS issue? I've tried various combinations of encrypt and trust server certificate parameters but to no avail.
77 replies