rengine icon indicating copy to clipboard operation
rengine copied to clipboard

fatal: not a git repository (or any of the parent directories): .git

Open Teicu opened this issue 2 years ago • 19 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

Does anyone have any idea why I get this error when I try to update to the latest version?

sudo ./update.sh Password: Do you want to apply your local changes after updating? (y/n) y COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml down [+] Running 7/7 ✔ Container rengine-proxy-1 Removed 0.4s ✔ Container rengine-web-1 Removed 10.2s ✔ Container rengine-celery-beat-1 Removed 0.0s ✔ Container rengine-celery-1 Removed 10.5s ✔ Container rengine-db-1 Removed 0.2s ✔ Container rengine-redis-1 Removed 0.2s ✔ Network rengine_rengine_network Removed 0.1s fatal: not a git repository (or any of the parent directories): .git

Expected Behavior

x

Steps To Reproduce

sudo ./update.sh

Environment

- reNgine: 2.0.0
- OS: MacOS
- Python: 
- Docker Engine: 
- Docker Compose: 
- Browser:

Anything else?

No response

Teicu avatar Oct 26 '23 09:10 Teicu

👋 Hi @Teicu, Issues is only for reporting a bug/feature request. Please read documentation before raising an issue https://rengine.wiki For very limited support, questions, and discussions, please join reNgine Discord channel: https://discord.gg/azv6fzhNCE Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

github-actions[bot] avatar Oct 26 '23 09:10 github-actions[bot]

Are you in the rengine folder when trying to run update.sh?

AnonymousWP avatar Oct 26 '23 10:10 AnonymousWP

Hi, yes of course.

Teicu avatar Oct 26 '23 10:10 Teicu

root@pentest rengine % sudo ./update.sh Do you want to apply your local changes after updating? (y/n) y COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml down No local changes to save hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. fatal: Need to specify how to reconcile divergent branches.

Teicu avatar Oct 26 '23 10:10 Teicu

Try git init, otherwise follow the steps that Git outputted for you as per your comment above.

AnonymousWP avatar Oct 26 '23 10:10 AnonymousWP

sudo ./update.sh Do you want to apply your local changes after updating? (y/n) y COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml down No local changes to save hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. fatal: Need to specify how to reconcile divergent branches. root@pentest rengine % sudo git config pull.rebase false root@pentest rengine % sudo git config pull.rebase true root@pentest rengine % sudo git config pull.ff only root@pentest rengine % sudo ./update.sh Do you want to apply your local changes after updating? (y/n) y COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml down No local changes to save hint: Diverging branches can't be fast-forwarded, you need to either: hint: hint: git merge --no-ff hint: hint: or: hint: hint: git rebase hint: hint: Disable this message with "git config advice.diverging false" fatal: Not possible to fast-forward, aborting. root@pentest rengine % git merge --no-ff fatal: refusing to merge unrelated histories root@pentest rengine % sudo git merge --no-ff fatal: refusing to merge unrelated histories root@pentest rengine % sudo git rebase error: The following untracked working tree files would be overwritten by checkout: .dockerignore .gitattributes .github/CODE_OF_CONDUCT.md .github/CONTRIBUTING.md .github/FUNDING.yml .github/ISSUE_TEMPLATE/bug_report.yaml .github/ISSUE_TEMPLATE/feature_request.yml .github/SECURITY.md .github/SPONSORS.md .github/screenshots/banner.gif .github/screenshots/scan_results.gif .github/workflows/auto-comment.yml .github/workflows/build-pr.yml .github/workflows/build.yml .github/workflows/codeql-analysis.yml .gitignore CHANGELOG.md CONTRIBUTORS.md LICENSE Makefile _config.yml certs/Dockerfile certs/entrypoint.sh config/nginx/rengine.conf docker-compose.dev.yml docker-compose.setup.yml docker-compose.yml install.sh make.bat scripts/uninstall.sh update.sh web/.gitignore web/Dockerfile web/api/init.py web/api/serializers.py web/api/urls.py web/api/views.py web/beat-entrypoint.sh web/celery-entrypoint.sh web/dashboard/init.py web/dashboard/admin.py web/dashboard/apps.py web/dashboard/migrations/0001_initial.py web/dashboard/migrations/0002_rename_name_searchhistory_query.py web/dashboard/migrations/0003_projects.py web/dashboard/migrations/0004_rename_projects_project.py web/dashboard/migrations/0005_alter_project_slug.py web/dashboard/migrations/0006_project_insert_date.py web/dashboard/migrations/0007_netlasapikey_openaiapikey.py web/dashboard/migrations/0007_openaikeys.py web/dashboard/migrations/0008_merge_0007_netlasapikey_openaiapikey_0007_openaikeys.py web/dashboard/migrations/0009_delete_openaikeys.py web/dashboard/migrations/init.py web/dashboard/models.py web/dashboard/templates/dashboard/admin.html web/dashboard/templates/dashboard/index.html web/dashboard/templates/dashboard/onboarding.html web/dashboard/templates/dashboard/profile.html web/dashboard/templates/dashboard/projects.html web/dashboard/templates/dashboard/search.html web/dashboard/tests.py web/dashboard/urls.py web/dashboard/views.py web/entrypoint.sh web/fixtures/default_keywords.yaml web/fixtures/default_scan_engines.yaml web/fixtures/external_tools.yaml web/manage.py web/reNgine/init.py web/reNgine/celery.py web/reNgine/celery_custom_task.py web/reNgine/common_func.py web/reNgine/common_serializers.py web/reNgine/context_processors.py web/reNgine/definitions.py web/reNgine/gpt.py web/reNgine/init.py web/reNgine/roles.py web/reNgine/settings.py web/reNgine/tasks.py web/reNgine/urls.py web/reNgine/utilities.py web/reNgine/validators.py web/reNgine/wsgi.py web/recon_note/init.py web/recon_note/admin.py web/recon_note/apps.py web/recon_note/migrations/0001_initial.py web/recon_note/migrations/0002_todonote_project.py web/recon_note/migrations/init.py web/recon_note/models.py web/recon_note/static/note/js/todo.js web/recon_note/templates/note/index.html web/recon_note/tests.py web/recon_note/urls.py web/recon_note/views.py web/scanEngine/init.py web/scanEngine/admin.py web/scanEngine/apps.py web/scanEngine/forms.py web/scanEngine/management/commands/dumpcustomengines.py web/scanEngine/management/commands/loadcustomengines.py web/scanEngine/migrations/0001_initial.py web/scanEngine/migrations/0002_auto_20220526_1457.py web/scanEngine/migrations/0003_enginetype_waf_detection.py web/scanEngine/migrations/0004_auto_20220816_0946.py web/scanEngine/migrations/0005_notification_send_scan_tracebacks.py web/scanEngine/migrations/0006_alter_installedexternaltool_version_lookup_command.py web/scanEngine/migrations/init.py web/scanEngine/models.py web/scanEngine/static/scanEngine/js/custom_scan_engine.js web/scanEngine/static/scanEngine/js/custom_tools.js web/scanEngine/static/scanEngine/js/tool_arsenal.js web/scanEngine/templates/scanEngine/_items/form_engine.html web/scanEngine/templates/scanEngine/add_engine.html web/scanEngine/templates/scanEngine/index.html web/scanEngine/templates/scanEngine/lookup.html web/scanEngine/templates/scanEngine/settings/_items/external_tool_form.html web/scanEngine/templates/scanEngine/sett Aborting error: could not detach HEAD

Teicu avatar Oct 26 '23 10:10 Teicu

rengine % sudo ./update.sh Do you want to apply your local changes after updating? (y/n) y COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml down [+] Running 1/0 ✔ Network rengine_default Removed 0.0s Saved working directory and index state WIP on (no branch): 133a8ca9 Merge pull request #1020 from AnonymousWP/bump-to-2.0.1 You are not currently on a branch. Please specify which branch you want to rebase against. See git-pull(1) for details.

git pull <remote> <branch>

Teicu avatar Oct 26 '23 10:10 Teicu

I just told you what to do, but you didn't try that yet it seems.

AnonymousWP avatar Oct 26 '23 10:10 AnonymousWP

I just told you what to do, but you didn't try that yet it seems.

I already did, but it's still useless

root@pentest rengine % sudo git init Reinitialized existing Git repository in /Users/root/rengine/.git/

sudo ./update.sh Do you want to apply your local changes after updating? (y/n) y COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml down Warning: No resource found to remove for project "rengine". No local changes to save Already up to date. On branch master Your branch is ahead of 'origin/master' by 3 commits. (use "git push" to publish your local commits)

nothing to commit, working tree clean COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml build db web proxy redis celery celery-beat parsing /Users/root/rengine/docker-compose.yml: yaml: line 99: could not find expected ':' make: *** [build] Error 15_

Teicu avatar Oct 26 '23 11:10 Teicu

  1. Try choosing n this time when it asks you if you want to apply local changes
  2. Which version of Docker Engine are you running?
  3. Which version of Docker Compose are you running?

Last two were part of the issue template, but you didn't fill it in.

AnonymousWP avatar Oct 26 '23 12:10 AnonymousWP

All good for now, thank you very much. Unfortunately, I have a new problem. Honestly, if I had known what to expect with this update I would have preferred to stay with version 2.0.0.

I restarted Docker (Docker Desktop 4.24.2 (124339) is currently the newest version available.) several times, the allocated resources are shown in the image, and I keep getting the error 502 Bad Gateway in the browser.

Screenshot 2023-10-26 at 13 19 49 Screenshot 2023-10-26 at 13 18 33 Screenshot 2023-10-26 at 13 17 29

Teicu avatar Oct 26 '23 12:10 Teicu

All good for now, thank you very much. Unfortunately, I have a new problem. Honestly, if I had known what to expect with this update I would have preferred to stay with version 2.0.0.

I restarted Docker (Docker Desktop 4.24.2 (124339) is currently the newest version available.) several times, the allocated resources are shown in the image, and I keep getting the error 502 Bad Gateway in the browser.

Screenshot 2023-10-26 at 13 19 49 Screenshot 2023-10-26 at 13 18 33 Screenshot 2023-10-26 at 13 17 29

How did you fix the initial issue?

Are all Docker containers still running? Also, you can't allocate so many resources if the host doesn't have them available either. Are you too using WSL 2?

AnonymousWP avatar Oct 26 '23 13:10 AnonymousWP

I changed with arm below in Dockerfile

RUN wget https://golang.org/dl/go1.20.linux-arm64.tar.gz RUN tar -xvf go1.20.linux-arm64.tar.gz RUN rm go1.20.linux-arm64.tar.gz RUN mv go /usr/local

I also replaced the old docker-compose.yml with the new one from here

I don't use WSL 2, I honestly don't even know what it is.

services are all runing

Screenshot 2023-10-26 at 14 31 01 Screenshot 2023-10-26 at 14 30 25

Teicu avatar Oct 26 '23 13:10 Teicu

@Teicu Did your setup works now ? If yes explain what you have did, thanks

psyray avatar Nov 18 '23 19:11 psyray

any solution for 502 Bad Gateway. I am getting the same.

jayjani007 avatar Nov 22 '23 09:11 jayjani007

any solution for 502 Bad Gateway. I am getting the same.

What have you tried so far?

AnonymousWP avatar Nov 22 '23 14:11 AnonymousWP

For all those with 502 Bad gateway Could you provide your docker-compose.yml please ?

psyray avatar Nov 22 '23 17:11 psyray

docker-compose.txt

Seems good. So as @AnonymousWP said what have you tried so far?

psyray avatar Nov 28 '23 15:11 psyray

@jayjani007 No feedback for 3 month, closing issue Feel free to open a new one if problem persists

psyray avatar Feb 21 '24 13:02 psyray