zeebs
zeebs
Explore posts from servers
PPrisma
Created by zeebs on 10/16/2024 in #help-and-questions
Accelerate - Which Neon Connection (Pooled or Direct)?
Thanks. That makes sense
5 replies
RRailway
Created by zeebs on 2/1/2024 in #✋|help
Request Help / Template demonstrating private networking connection to Postgres
Thanks @Brody & @Lelebees. I finally got it working with the additions of the following tweaks for my instance.... Append /?family=6 to the end of the Redis URL => REDIS_URL=${{Redis.REDIS_PRIVATE_URL}}/?family=6 This ensures that the DNS resolution looks for IPV6 as per the following thread https://github.com/redis/ioredis/issues/1576 ** Add ENABLE_ALPINE_PRIVATE_NETWORKING=true as mentioned in your docs https://docs.railway.app/guides/private-networking
9 replies
RRailway
Created by zeebs on 2/1/2024 in #✋|help
Request Help / Template demonstrating private networking connection to Postgres
and a9776b4e-bbcb-4a5d-9d9c-2f15387d4118
9 replies
RRailway
Created by zeebs on 2/1/2024 in #✋|help
Request Help / Template demonstrating private networking connection to Postgres
adc1afb3-6652-4f08-9ac3-0dda485170c8
9 replies
RRailway
Created by zeebs on 1/8/2024 in #✋|help
Disable Cache for build step on Railway
I've also pushed my working docker-image to ghcr.io and tried to deploy using this source-image... but can't seem to get the configuration right to work on Railway. Deployment fails and there are no logs to trouble-shoot why
6 replies
RRailway
Created by zeebs on 1/8/2024 in #✋|help
Disable Cache for build step on Railway
FROM ghcr.io/railwayapp/nixpacks:ubuntu-1702339400

ENTRYPOINT ["/bin/bash", "-l", "-c"]
WORKDIR /app/


COPY nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix
RUN nix-env -if nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d


ARG CI NIXPACKS_METADATA NODE_ENV NPM_CONFIG_PRODUCTION SERVER_ONLY
ENV CI=$CI NIXPACKS_METADATA=$NIXPACKS_METADATA NODE_ENV=$NODE_ENV NPM_CONFIG_PRODUCTION=$NPM_CONFIG_PRODUCTION SERVER_ONLY=$SERVER_ONLY

# setup phase
# noop

# install phase
ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
COPY . /app/.
RUN npm i

# build phase
COPY . /app/.
RUN npm run build

RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile


# start
COPY . /app
CMD ["medusa migrations run && medusa start"]
FROM ghcr.io/railwayapp/nixpacks:ubuntu-1702339400

ENTRYPOINT ["/bin/bash", "-l", "-c"]
WORKDIR /app/


COPY nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix
RUN nix-env -if nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d


ARG CI NIXPACKS_METADATA NODE_ENV NPM_CONFIG_PRODUCTION SERVER_ONLY
ENV CI=$CI NIXPACKS_METADATA=$NIXPACKS_METADATA NODE_ENV=$NODE_ENV NPM_CONFIG_PRODUCTION=$NPM_CONFIG_PRODUCTION SERVER_ONLY=$SERVER_ONLY

# setup phase
# noop

# install phase
ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
COPY . /app/.
RUN npm i

# build phase
COPY . /app/.
RUN npm run build

RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile


# start
COPY . /app
CMD ["medusa migrations run && medusa start"]
6 replies
RRailway
Created by zeebs on 1/8/2024 in #✋|help
Disable Cache for build step on Railway
Hi @Brody ... I'm really pulling my hair out on this one! I'm deploying a Medusa backend and have extended the product service. Everything works on my local machine, however I get the following error on my production instance on Railway...
165.165.142.241 - - [09/Jan/2024:10:15:05 +0000] "GET /store/products HTTP/1.1" 500 86 "-" "PostmanRuntime/7.36.0"
running custom product listAndCount
error: productRepo.findWithRelationsAndCount is not a function
TypeError: productRepo.findWithRelationsAndCount is not a function
at ProductService.<anonymous> (/app/node_modules/@medusajs/medusa/dist/services/product.js:197:62)
at step (/app/node_modules/@medusajs/medusa/dist/services/product.js:59:23)
at Object.next (/app/node_modules/@medusajs/medusa/dist/services/product.js:40:53)
at /app/node_modules/@medusajs/medusa/dist/services/product.js:34:71
at new Promise (<anonymous>)
at __awaiter (/app/node_modules/@medusajs/medusa/dist/services/product.js:30:12)
at ProductService.listAndCount (/app/node_modules/@medusajs/medusa/dist/services/product.js:186:16)
at ProductService.listAndCount (/app/dist/services/product.js:38:28)
at /app/node_modules/@medusajs/medusa/dist/api/routes/store/products/list-products.js:335:50
at step (/app/node_modules/@medusajs/medusa/dist/api/routes/store/products/list-products.js:68:23)
165.165.142.241 - - [09/Jan/2024:10:15:05 +0000] "GET /store/products HTTP/1.1" 500 86 "-" "PostmanRuntime/7.36.0"
running custom product listAndCount
error: productRepo.findWithRelationsAndCount is not a function
TypeError: productRepo.findWithRelationsAndCount is not a function
at ProductService.<anonymous> (/app/node_modules/@medusajs/medusa/dist/services/product.js:197:62)
at step (/app/node_modules/@medusajs/medusa/dist/services/product.js:59:23)
at Object.next (/app/node_modules/@medusajs/medusa/dist/services/product.js:40:53)
at /app/node_modules/@medusajs/medusa/dist/services/product.js:34:71
at new Promise (<anonymous>)
at __awaiter (/app/node_modules/@medusajs/medusa/dist/services/product.js:30:12)
at ProductService.listAndCount (/app/node_modules/@medusajs/medusa/dist/services/product.js:186:16)
at ProductService.listAndCount (/app/dist/services/product.js:38:28)
at /app/node_modules/@medusajs/medusa/dist/api/routes/store/products/list-products.js:335:50
at step (/app/node_modules/@medusajs/medusa/dist/api/routes/store/products/list-products.js:68:23)
in trying to debug this issue, I have tried my best to reproduce the Railway deploy environment on my local machine: + Build with Nixpacks locally and run with Docker (works as expected locally) + Build with Docker using Dockerfile (modified Nixpacks output).... and build on Railway with same Dockerfile + still works as expected locally but throws above error on Railway I'm running out of ideas why this is happening. Dockerfile below for interest... '''
6 replies