#Unable to upload images

41 messages · Page 1 of 1 (latest)

signal thorn
#

In the medusa admin panel i'm getting this error when i try to add a product. I'm running it locally on the sqlite db

celest snow
hollow mist
#

here is the screenshot of configuration and errors that i am getting

#

here is the error after "Medusa develop"

plush ridge
#

@hollow mist A few ideas to try:

  1. Postgres' url doesn't look correct: it should be postgres:// , you have postgresql://

  2. Run redis with redis-server like usual, then open another terminal and run redis-cli FLUSHALL and redis-cli FLUSHDB to clear out anything whacky on that side. (Just a precaution)

  3. Make sure every package is up to date, update medusa, medusa-js, typeorm, and medusa-interfaces are all good

hollow mist
#

Yeah did that it remains the same

#

now i am trying to do with minio

#

configuration + error

#

in server

#

while working with minio

hollow mist
#

@plush ridge

plush ridge
# hollow mist <@97482401394982912>

Hmmm, I'd still say keep postgresql:// as postgres:// in .env, that url you are using won't allow you to connect to the DB to begin with. Can you paste in your entire medusa-config?

hollow mist
#

const dotenv = require('dotenv')

let ENV_FILE_NAME = '';
switch (process.env.NODE_ENV) {
case 'production':
ENV_FILE_NAME = '.env.production';
break;
case 'staging':
ENV_FILE_NAME = '.env.staging';
break;
case 'test':
ENV_FILE_NAME = '.env.test';
break;
case 'development':
default:
ENV_FILE_NAME = '.env';
break;
}

try {
dotenv.config({ path: process.cwd() + '/' + ENV_FILE_NAME });
} catch (e) {
}

// CORS when consuming Medusa from admin
const ADMIN_CORS = process.env.ADMIN_CORS || "http://localhost:7000,http://localhost:7001";

// CORS to avoid issues when consuming Medusa from a client
const STORE_CORS = process.env.STORE_CORS || "http://localhost:8000";

#

// Database URL (here we use a local database called medusa-development)
const DATABASE_URL =
process.env.DATABASE_URL || "postgres://localhost/medusa-store";

// Medusa uses Redis, so this needs configuration as well
const REDIS_URL = process.env.REDIS_URL || "redis://localhost:6379";

// Stripe keys
const STRIPE_API_KEY = process.env.STRIPE_API_KEY || "";
const STRIPE_WEBHOOK_SECRET = process.env.STRIPE_WEBHOOK_SECRET || "";

// This is the place to include plugins. See API documentation for a thorough guide on plugins.
const plugins = [
medusa-fulfillment-manual,
medusa-payment-manual,
// {
// 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,
// },
// },
// Uncomment to add Stripe support.
// You can create a Stripe account via: https://stripe.com
// {
// resolve: medusa-payment-stripe,
// options: {
// api_key: STRIPE_API_KEY,
// webhook_secret: STRIPE_WEBHOOK_SECRET,
// },
// },
];

module.exports = {
projectConfig: {
redis_url: REDIS_URL,
// For more production-like environment install PostgresQL
database_url: DATABASE_URL,
database_type: "postgres",
database_database: "./medusa-db.sql",
// database_type: "sqlite",
store_cors: STORE_CORS,
admin_cors: ADMIN_CORS,

},
plugins,

};

Stripe is a suite of APIs powering online payment processing and commerce solutions for internet businesses of all sizes. Accept payments and scale faster.

#

hey this is Medusa js file

#

@plush ridge

plush ridge
#

Try commenting database_database: "./medusa-db.sql" out, its trying to reach for a file database in your root directory when it should be trying to access postgres on localhost

hollow mist
#

configuration

#

ok

#

trying

hollow mist
#

?

#

@plush ridge

plush ridge
hollow mist
plush ridge
#

That git issue was typeorm as well, medusa migrations run might be worth a try to use befoere you start the server

plush ridge
#

also make sure you seeded the posgres db

hollow mist
#

?

plush ridge
#

If you run medusa seed it will move demo data into the postgres database

hollow mist
plush ridge
hollow mist