Comments (19)
@smaharj1 I finally got S3 to work. Below is the Bucket Policy I set:
{
"Version": "2012-10-17",
"Id": "Policy1594102782490",
"Statement": [
{
"Sid": "Stmt15941012824",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::name-of-bucket"
}
]
}
and this is the CORS config that I used:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>http://localhost:5202</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<ExposeHeader>x-amz-server-side-encryption</ExposeHeader>
<ExposeHeader>x-amz-request-id</ExposeHeader>
<ExposeHeader>x-amz-id-2</ExposeHeader>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
from veniqa.
@smaharj1 I feel like this issue needs to be separated from this discussion thread as the topics aren't the same. Please refer to and provide a solution at #132.
Thanks buddy!
from veniqa.
You can actually access your Docker mongo instance by locally accessing port 27000. However, if you want to use your own Mongo Atlas, you just need to change the Mongo URL in the environment file. Please refer to this document for more info on how to do so.
from veniqa.
@smaharj1 So that I am aware of. Now here's what's happening. I see the collections have been created on my Atlas however those collections are empty. However, only after I have initialized the Veniqa Docker Container (docker-compose up), I am able to access Mongo on port 27000 and see the collections with documents in them.
If I do not start the platform using docker, I get a Winston JS error stating that I need to specify a DB to connect to. It's quite weird really...
All in all, I am as of now running Veniqa on my local system with the Mongo URL set to my Atlas URL. However, the collections in Atlas have no documents in them but the Mongo instance running on port 27000 (on my local machine) has the necessary documents (the ones found in the data dump folder of this repo). Please refer to the screenshot.
This is what I see on my Mongo Atlas
from veniqa.
The winston error is the desired behavior. If you want to directly connect to Atlas, please change/add the URL of Atlas in .env
file in your server project. That way you don't have to run docker at all. Docker is not essential for running the application. We created it later to consolidate all the apps in one run. You can run everything separately by just switching to .env
files in your individual projects.
from veniqa.
So I have populated the .env file in management-webclient and management-server with the necessary credentials and I have renamed the file to .env.development.
Post these steps, I am receiving the Winston error.
What did you mean by "switching to .env files in your individual projects." Have I missed something?
from veniqa.
Can you rename it to .env
(without .development) and try? No. You didn't miss anything
from veniqa.
I have now changed the file name to just .env
and I now see the following in my terminal: -
However localhost:4202
cannot be connected to. It seems like the API is offline (it's a guess since if I go to localhost:4202
it says that my browser cannot find the page). Below are the console logs:
from veniqa.
I am as of now running Veniqa on my local system with the Mongo URL set to my Atlas URL. However, the collections in Atlas have no documents in them but the Mongo instance running on port 27000 (on my local machine) has the necessary documents (the ones found in the data dump folder of this repo). Please refer to the screenshot.
This is what I see on my Mongo Atlas
This issue of mine still stands. I am weirded out by how none of this problems arise when the whole platform is set up using docker.
from veniqa.
I see that in /bin/www
, the port number is 3000. Please call localhost:3000
to get successful calls. The port is only 4202 if you are doing through Docker. If you want to change the port locally, you can either pass an environment variable PORT
in .env
file or change the default port in /bin/www
.
from veniqa.
I changed the AWS info in the .env
file to my account's creds and also updated the config/default.json
to match the location.
Along with that I went into my AWS S3 account and made the bucket public to see if that is causing the issue. Doing so also made no difference. What should I be doing here?
from veniqa.
I see that in
/bin/www
, the port number is 3000. Please calllocalhost:3000
to get successful calls. The port is only 4202 if you are doing through Docker. If you want to change the port locally, you can either pass an environment variablePORT
in.env
file or change the default port in/bin/www
.
I made this change and tried accessing localhost:3000 through my browser and it is stuck in an endless "loading" state.
from veniqa.
I have been trying like crazy and I keep getting Error Code 403 Forbidden when I attempt to upload images to my S3. It seems to be caused because of some CORS error.
@Viveckh maybe you could help me out here since it is a backend task.
This is one of the errors :
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at... (url to the bucket)
and then I see a bunch of Reason: CORS request did not succeed)
and Reason: CORS header ‘Access-Control-Allow-Origin’ missing
I even went ahead and wrote up a CORS config:
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
What have you guys done to get this to work?
from veniqa.
I have been trying like crazy and I keep getting Error Code 403 Forbidden when I attempt to upload images to my S3. It seems to be caused because of some CORS error.
@Viveckh maybe you could help me out here since it is a backend task.
This is one of the errors :
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at... (url to the bucket)
and then I see a bunch of
Reason: CORS request did not succeed)
andReason: CORS header ‘Access-Control-Allow-Origin’ missing
I even went ahead and wrote up a CORS config:
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>HEAD</AllowedMethod> <AllowedHeader>*</AllowedHeader> </CORSRule> </CORSConfiguration>
What have you guys done to get this to work?
I think the problem here is the bucket policy. As you can see from your code, only GET
method is allowed. Maybe this can help you set the bucket policy.
from veniqa.
Now that I am able to upload images to my S3, upon saving the new product, the management-server logs on my terminal show me the following error:
Not sure what's causing this.
Also, in my S3, I am seeing all the images that I had uploaded in the "thumbnail" folder. Is that supposed to happen? I understand that all of them need to be present in the "detailed images" folder but shouldn't only the image that is set as the thumbnail be a part of the "thumbnails" folder?
from veniqa.
@AmandaDLyon what do you get in the API response for this? Specifically trying to look at errorDetails
in response.
from veniqa.
@smaharj1 Its a Code 500 (Internal Server Error).
from veniqa.
Its a Code 500 (Internal Server Error).
from veniqa.
@smaharj1 I re-installed the whole platform after running docker system prune -a
and then running docker-compose up
thinking maybe this might fix the issue, however that did not help.
Could you attempt to add or edit an existing problem to check if the issue persists on your end as well. Ideally it shouldn't. I am wondering if this is a bad config on my local machine. Maybe permissions issue..?
from veniqa.
Related Issues (20)
- 3D Secure Card Payment HOT 17
- New order does not show in admin dashboard HOT 3
- getting error during installation HOT 2
- BUG: Issue with Safari not passing cookie/session info HOT 11
- Re-routing to last open URL upon login HOT 2
- Visual Bug HOT 1
- Visual Bug HOT 2
- Cannot Add/Edit a product HOT 6
- Order Recieved Email HOT 1
- Deploying to Production HOT 4
- Admin Login Credentials HOT 2
- Lots of deprecated packages HOT 2
- BUG HOT 1
- Feature request: Register as a seller HOT 1
- Empty database, how am I supposed to login on my local env? HOT 1
- Demo admin panel credentials not working HOT 1
- BUG <Config docker> Docker compose up error E11000 duplicate key error collection HOT 1
- BUG: docker-compose up dependency issue: cannot resolve axios@"^0.16.2” HOT 1
- BUG #0 99.25 npm ERR! code 1 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from veniqa.