pauldps
pauldps
RRailway
Created by pauldps on 7/5/2024 in #✋|help
Dashboard: all services are invisible (visual bug)
No description
14 replies
RRailway
Created by pauldps on 7/4/2024 in #✋|help
V2 + App Sleep = first response always empty
I recently deployed a new Bun API on V2 with App Sleep, and I've noticed that the first request to a sleeping app always returns an empty response. This hasn't happened on non-V2 Bun apps with App Sleep on. The following are tests with curl using the same URL/endpoint. Normal request (non-sleeping app, {"status": "OK"} is the response from my API):
HTTP/2 200
content-type: application/json;charset=utf-8
date: Thu, 04 Jul 2024 06:03:09 GMT
server: railway-edge
x-request-id: 56xHFuw3QlCDX-2Zclvhkw_3165824431
content-length: 15

{"status":"OK"}
real 0m0.269s
user 0m0.016s
sys 0m0.000s
HTTP/2 200
content-type: application/json;charset=utf-8
date: Thu, 04 Jul 2024 06:03:09 GMT
server: railway-edge
x-request-id: 56xHFuw3QlCDX-2Zclvhkw_3165824431
content-length: 15

{"status":"OK"}
real 0m0.269s
user 0m0.016s
sys 0m0.000s
First request on the same app but sleeping:
HTTP/2 200
server: railway-edge
x-request-id: Z4G6GgaAQziEbf20vOO_UQ_3165824431
content-length: 0
date: Thu, 04 Jul 2024 06:02:56 GMT


real 0m1.275s
user 0m0.000s
sys 0m0.000s
HTTP/2 200
server: railway-edge
x-request-id: Z4G6GgaAQziEbf20vOO_UQ_3165824431
content-length: 0
date: Thu, 04 Jul 2024 06:02:56 GMT


real 0m1.275s
user 0m0.000s
sys 0m0.000s
Project ID: 34304961-2ebf-4d0b-b2ae-3585cf6b9353
303 replies
RRailway
Created by pauldps on 5/5/2024 in #✋|help
Idle Rails app not sleeping
No description
30 replies
RRailway
Created by pauldps on 3/18/2024 in #✋|help
Private URL not working (public URL works fine)
I've spun a new database service inside my project to run a libSQL database (https://github.com/tursodatabase/libsql/blob/main/docs/DOCKER.md). The service itself is running fine and I can connect to it via its public URL from another service (a Bun API) inside the same project. But using the private URL to connect does not work. This is what I've done: - Enabled private networking for both apps - Added 3s of sleep before the start command. I can see the delays in my logs. From my Dockerfile:
ENTRYPOINT [ "/bin/sh", "-c", "sleep 3; ./migrator && ./server" ]
ENTRYPOINT [ "/bin/sh", "-c", "sleep 3; ./migrator && ./server" ]
- "migrator" is an executable that runs migrations on my database, and "server" is the API itself. The errors are coming from my migrator command. - Manually set the PORT env variable in the libSQL service so that I can use it in the private URL from the API - (just in case) Added ENABLE_ALPINE_PRIVATE_NETWORKING as true in my API service. I'm using an external image in my Dockerfile that I'm not sure is Alpine, so this might not be having an effect. API logs (with private URL and port):
Connecting to database: http://webmuds-libsql.railway.internal:8080
ConnectionRefused: Unable to connect. Is the computer able to access the url?
path: "http://webmuds-libsql.railway.internal:8080/v2/pipeline";
Connecting to database: http://webmuds-libsql.railway.internal:8080
ConnectionRefused: Unable to connect. Is the computer able to access the url?
path: "http://webmuds-libsql.railway.internal:8080/v2/pipeline";
(... repeat until health check timeout...)
Connecting to database: http://webmuds-libsql.railway.internal:8080
ConnectionRefused: Unable to connect. Is the computer able to access the url?
path: "http://webmuds-libsql.railway.internal:8080/v2/pipeline";
Connecting to database: http://webmuds-libsql.railway.internal:8080
ConnectionRefused: Unable to connect. Is the computer able to access the url?
path: "http://webmuds-libsql.railway.internal:8080/v2/pipeline";
(... repeat until health check timeout...)
Project ID: 71754a48-09bb-4250-b361-ff5ab1df9597
21 replies
RRailway
Created by pauldps on 9/18/2022 in #✋|help
Crystal app memory usage seems incorrect (and keeps growing)
A few days ago I deployed a Crystal app, it's a web api that uses less than 10MB of memory (running it locally it uses less than 1MB of memory) but Railway reports 40MB usage, and it keeps growing at about a 10MB/day rate every day without use (according to logs). I am not running other processes in the background, it's just an executable that serves an API and connects to a cockroachDB database elsewhere. I'd like to better understand why Railway is reporting 40MB (and the growth) as I think it's unlikely to be caused by the executable I'm running.
6 replies
RRailway
Created by pauldps on 9/14/2022 in #✋|help
Crystal+Lucky+Nixpacks failing to build with openssl errors
Hi, I'm trying to deploy a simple Crystal app using the Lucky lib (which uses SSL) and the deploy is failing to build. I've confirmed that the default Nixpack for Crystal already includes openssl and pkg-config, but the deploy is failing with the following:
#13 1.084 Error target app failed to compile:
#13 1.084 <stdin>:1:10: fatal error: 'openssl/opensslv.h' file not found
#13 1.084 #include <openssl/opensslv.h>
#13 1.084 ^~~~~~~~~~~~~~~~~~~~
#13 1.084 1 error generated.
#13 1.084 Showing last frame. Use --error-trace for full trace.
#13 1.084
#13 1.084 In /nix/store/wp989av138zf83mhna2p3fd0bqgqya6v-crystal-1.2.2-lib/crystal/openssl/lib_crypto.cr:5:25
#13 1.084
#13 1.084 5 | (`printf "#include <openssl/opensslv.h>\nLIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libcrypto || true) -E -`.chomp.split('\n').last != "LIBRESSL_VERSION_NUMBER") %}
#13 1.084 ^
#13 1.084 Error: error executing command: printf "#include <openssl/opensslv.h>
#13 1.084
#13 1.084 LIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libcrypto || true) -E -, got exit status 1:
#13 1.084 Error target app failed to compile:
#13 1.084 <stdin>:1:10: fatal error: 'openssl/opensslv.h' file not found
#13 1.084 #include <openssl/opensslv.h>
#13 1.084 ^~~~~~~~~~~~~~~~~~~~
#13 1.084 1 error generated.
#13 1.084 Showing last frame. Use --error-trace for full trace.
#13 1.084
#13 1.084 In /nix/store/wp989av138zf83mhna2p3fd0bqgqya6v-crystal-1.2.2-lib/crystal/openssl/lib_crypto.cr:5:25
#13 1.084
#13 1.084 5 | (`printf "#include <openssl/opensslv.h>\nLIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libcrypto || true) -E -`.chomp.split('\n').last != "LIBRESSL_VERSION_NUMBER") %}
#13 1.084 ^
#13 1.084 Error: error executing command: printf "#include <openssl/opensslv.h>
#13 1.084
#13 1.084 LIBRESSL_VERSION_NUMBER" | ${CC:-cc} $(pkg-config --cflags --silence-errors libcrypto || true) -E -, got exit status 1:
My project has a nixpacks.toml file that includes the requirements for Lucky (relevant one is libssl-dev):
[phases.setup]
aptPkgs = ['...', 'libc6-dev', 'libevent-dev', 'libpcre2-dev', 'libpng-dev', 'libssl-dev', 'libyaml-dev', 'zlib1g-dev']
[phases.setup]
aptPkgs = ['...', 'libc6-dev', 'libevent-dev', 'libpcre2-dev', 'libpng-dev', 'libssl-dev', 'libyaml-dev', 'zlib1g-dev']
I've ran out of options. The project runs fine locally. Any advice?
54 replies