#Unable to use railway minio with medusa

20 messages · Page 1 of 1 (latest)

wary linden
#

Hi,
I've followed the steps of the plugin documentation.
I succeed to access the railway minio console.
When adding an image in the admin, I have this error:

::1 - - [16/Feb/2024:18:08:32 +0000] "GET /admin/batch-jobs?limit=100 HTTP/1.1" 304 - "http://localhost:7001/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
error:   null
503: null
    at Request.extractError (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/services/s3.js:712:35)
    at Request.callListeners (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/request.js:686:14)
    at Request.transition (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/request.js:688:12)
    at Request.callListeners (/Users/saadchraibi/playgrounds/medusa/medusa14/medusa14/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
  code: 503,
  region: null,
  time: 2024-02-16T18:08:37.705Z,
  requestId: null,
  extendedRequestId: undefined,
  cfId: undefined,
  statusCode: 503,
  retryable: true
}
#
::1 - - [16/Feb/2024:18:08:37 +0000] "POST /admin/uploads HTTP/1.1" 500 86 "http://localhost:7001/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"

I also noticed that there also a user and password credentials in the minio railway backend instance but there no mention of them in the docs

quasi oracle
#

Single node minio?

wary linden
#

I've run a template of minio in railway on a separate environement.
I am not sure whether it's a single node or no? How could I know this information?

quasi oracle
#

Most probably it is so makes not much sense. What is in the minio logs?

#

Are the endpoint address and port working? Can you connect to it?

wary linden
#

This is the deploy logs of the backend:

Formatting 1st pool, 1 set(s), 1 drives per set.

WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.

MinIO Object Storage Server

Copyright: 2015-2024 MinIO, Inc.

License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>;

Version: RELEASE.2024-02-14T21-36-02Z (go1.21.7 linux/amd64)

Status:         1 Online, 0 Offline.

S3-API: http://172.17.0.12:9000  http://127.0.0.1:9000

Console: http://172.17.0.12:45001 http://127.0.0.1:45001

Documentation: https://min.io/docs/minio/linux/index.html

Warning: The standard parity is set to 0. This can lead to data loss.

When I click on https://bucket-production-6383.up.railway.app, I have a railway error page. Could this have something to do with the credentials?
ChatGPT suggested to set those credentials as the access_key and the secret key as opposed to what was suggested in the docs that recommended to use the access_key generated in the console

As for the port, I have no seen a mention to it.
I am only able to log to the console

viral rock
#

Unrelated but are you running medusa in dev mode on Railway?

#

Why are the requests coming from localhost:7001 : ::1 - - [16/Feb/2024:18:08:37 +0000] "POST /admin/uploads HTTP/1.1" 500 86 "http://localhost:7001/"

wary linden
#

For development, I am using a local environement on my MAC with docker containers of redis and postgres.
I am using bucket on railway and test it first with my local environement

viral rock
#

I would say it has nothing to do with medusa now, and you have failed to deploy Minio

#

But I'm not sure

#

Can you upload an image in the console?

#

Also I'm not sure if it's convenient to deploy minio to railway, instead of using Spaces or S3. I would use Minio if I were to self host it.

wary linden
#

I am able to upload an image in the console.
I thought that it would be convenient to use in railway as there was a template, and because I had already a plan there
For some reason, S3 is bugging (404 error in the amazon web service S3 page)

viral rock
#

And how does your config look like

wary linden
#

#1129330100773584986 message
It seems I have the same error than this message OP. But I am not sure if he resolved it.

  {
    resolve: `medusa-plugin-sendgrid`,
    options: {
      api_key: process.env.SENDGRID_API_KEY,
      from: process.env.SENDGRID_FROM,
      order_placed_template: process.env.SENDGRID_ORDER_PLACED_ID,
    },
  },
  {
    resolve: `medusa-file-minio`,
    options: {
      endpoint: process.env.MINIO_ENDPOINT,
      bucket: process.env.MINIO_BUCKET,
      access_key_id: process.env.MINIO_ACCESS_KEY,
      secret_access_key: process.env.MINIO_SECRET_KEY,
    },
  },
viral rock
#

I don't see the same error here and there. WHere do you see it? you haven't mentioned anything that's similar to that other thread.

wary linden
#

#1129330100773584986 message
Sorry for not being explicit enough
I see the exact message he is seeing, we both use minio on railway.
When inspecting my admin console , I find the same message

:9000/admin/uploads:1 
        
        
       Failed to load resource: the server responded with a status of 500 (Internal Server Error)
viral rock
#

Yeah but in the backend logs there's a 503 which would mean service unavailable