Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup of talawa-api in local machine using docker is giving error regarding "PWD" variable not set correctly #2598

Open
DipanshuOjha opened this issue Oct 18, 2024 · 23 comments
Assignees
Labels
bug Something isn't working

Comments

@DipanshuOjha
Copy link

Describe the bug
A clear and concise description of what the bug is.

This bug is regarding docker-compose.dev.yaml file because of which we are not able to set-up talawa-api in our system.

Expected behavior
It should setup the talawa-api by successfully creating 3 docker containers

  1. mongodb
    2.redis-stack-server
    3.minio
    upon which the "talawa-api-dev" services depends

Actual behavior
A clear and concise description of how the code performed w.r.t expectations.
Error indicate that mongodb is not able to established connection with other containers

I have attached the screenshot for more detail

Screenshots
Screenshot (141)

Please read this if you are planning to apply for a Palisadoes Foundation internship

@DipanshuOjha DipanshuOjha added the bug Something isn't working label Oct 18, 2024
Copy link

Congratulations on making your first Issue! 🎊 If you haven't already, check out our Contributing Guidelines and Issue Reporting Guidelines to ensure that you are following our guidelines for contributing and making issues.

@github-actions github-actions bot added the unapproved Unapproved for Pull Request label Oct 18, 2024
@vaibhavityagi
Copy link

vaibhavityagi commented Oct 18, 2024

This is a redis-stack-server not found error, which occurs due to the talawa-api container creating a default network when it is first mounted. And then obviously there are issues with the caddy service.
image

I have faced all these issues while trying to set up the project locally and spent hours finding the fix. I would love to take it up!

@pranshugupta54
Copy link
Member

@vaibhavityagi, You currently have 2 issues. Our policy is to assign no more than two issues to each contributor across all repositories. This way everyone gets a chance to participate in the projects. We sometimes give exceptions for more urgent cases and sometimes we lose track, but the policy stands. You have reached your limit, please wait until your existing issues are closed before requesting more issues. You could unassign yourself from one of the other issues too.

@vaibhavityagi
Copy link

vaibhavityagi commented Oct 18, 2024

@pranshugupta54 I have unassigned myself from one of the issues as it was already fixed.

@DipanshuOjha
Copy link
Author

Hey
I would also like to work on this issue.

@pranshugupta54
Copy link
Member

pranshugupta54 commented Oct 19, 2024

Hey @DipanshuOjha, this issue is already assigned. You can comment on other issues which are open and not yet assigned.

@varshith257 varshith257 removed the unapproved Unapproved for Pull Request label Oct 19, 2024
@vaibhavityagi
Copy link

I have found all the fixes. Looking for the Caddyfile fix, will raise a PR in a week

@palisadoes
Copy link
Contributor

palisadoes commented Oct 31, 2024

@vaibhavityagi

  1. Update the setup script to modify the .env file in the root directory of the talawa-api repository to have a PWD entry as shown below. This will set up the "PWD" variable and if we again run the command for docker build, it will get successfully executed.
PWD=.
  1. This must only be done when the Docker option is set
  2. The "PWD" entry must not be present when the Docker option is not set
  3. This behavior must be automatic
  4. Valid tests must be written for your work so that this does not happen again.
    1. The setup script has its own set of tests
  5. No other functionality must be altered

@abhayymishraa
Copy link

abhayymishraa commented Nov 8, 2024

anyone working on this ?? . i found the bug because of why we are not able to access the api server on main branch through docker !! assign it to me

@abhayymishraa
Copy link

i have raised the pr but should i add the things that the workflow suggests???

@palisadoes
Copy link
Contributor

palisadoes commented Nov 10, 2024

  1. We need the functionality as described in original issue comment.
  2. You will need to make sure that the existing test that ensures the API starts is not affected. You may have to stop the app before your docker starting test begins.

@palisadoes
Copy link
Contributor

During the week of November 11, 2024 we will start a code freeze on the develop branches in Talawa, Talawa Admin and Talawa-API.

We have completed a project to convert the Talawa-API backend to use PostgreSQL. Work will then begin with us merging code in the develop branches to a new develop-postrgres branch in each repository.

Planning activities for this will be managed in our #talawa-projects slack channel. A GitHub project will be created to track specially labeled issues. We completed a similar exercise last year using a similar methodology.

Starting November 12, California time no new PRs will be accepted against the develop branch. They must be applied to the develop-postrgres branch.

There are some GSoC project features that will need to be merged into develop. These will be the only exceptions.

This activity and the post GSoC 2024 start date was announced in our #general Slack channel last month as a pinned post.

@abhayymishraa
Copy link

abhayymishraa commented Nov 11, 2024

i did fix but the caddy is giving error in the docker-compose.dev cause it didnt get ssl it will not fail in production thats why i had tallk with maintainers in the slack they adviced me to do this separate the docker-compose.cloud and fix the docker-compose.dev which i did and now if we run from the command npm run test it is working fine from system so what will now i do ? will i need to go back like how previous docker-compose.dev configuration and fix that database not connecting issue or i continue with this?? @palisadoes
also what about the pwd its fine for me i didnt get any error while others are getting error should i add a condition when start with docker option so the env add PWD = .

@abhayymishraa
Copy link

updatess??
@palisadoes

@abhayymishraa
Copy link

Also i found a bug in the testcase thats why the test cases are failing !!!! and i fixed it

@palisadoes
Copy link
Contributor

Please ask the #talawa-api channel in slack

@palisadoes
Copy link
Contributor

Unassigning. Inactivity in the PR

@abhayymishraa
Copy link

@palisadoes i was working on it
but i dont find where to make a pr as gc is unactive

@palisadoes
Copy link
Contributor

I'm going to assign this to someone else. The PR was abandoned.
@Shriya-Chauhan You created an issue for this. Please ask to be assigned.

@Shriya-Chauhan
Copy link

@palisadoes Yes! Please assign this issue to me. I am working on this.

@Shriya-Chauhan
Copy link

Shriya-Chauhan commented Dec 3, 2024

Fixes I have done and thinking:

  1. Added PWD=. in .env file.Reason: This will fix the path errors eg. caddyfile mount error, pwd variable error.
  2. The documentation is not clear enough for all OS users wrt to docker. For eg. I faced issue Port already in use which requires off documentation assistance.

Doubt: Reason behind using 80 port?

image

I have made some changes. Please review! #2734

@abhayymishraa
Copy link

@Shriya-Chauhan
maybe reason behind is that it is a docker file for production so maybe both http and https request are allowed also everything is reverse proxied to the api

@palisadoes
Copy link
Contributor

@Shriya-Chauhan

This may be related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants