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

Server Error 500 #1297

Closed
1 task done
bagialuudan opened this issue Jul 2, 2024 · 8 comments
Closed
1 task done

Server Error 500 #1297

bagialuudan opened this issue Jul 2, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@bagialuudan
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When i update ver 2.0.6 -> 2.1, I cannot access web because this is server error 500

Expected Behavior

log:
django.server | "GET /favicon.ico HTTP/1.0" 302 0
django.server | "GET /login/?next=/favicon.ico HTTP/1.0" 200 4516
django.server | "POST /login/?next=/default/dashboard/ HTTP/1.0" 200 4884
django.server | "GET /favicon.ico HTTP/1.0" 302 0
django.server | "GET /login/?next=/favicon.ico HTTP/1.0" 200 4516
django.server | "POST /login/?next=/default/dashboard/ HTTP/1.0" 200 4884
django.server | "GET /favicon.ico HTTP/1.0" 302 0
django.server | "GET /login/?next=/favicon.ico HTTP/1.0" 200 4516
django.server | "POST /login/?next=/default/dashboard/ HTTP/1.0" 302 0
django.server | "GET /default/dashboard/ HTTP/1.0" 500 145
django.server | "GET /favicon.ico HTTP/1.0" 500 145
django.server | "GET /default/dashboard/ HTTP/1.0" 500 145
django.server | "GET /favicon.ico HTTP/1.0" 500 145
django.server | "GET /default/dashboard/ HTTP/1.0" 500 145
django.server | "GET /favicon.ico HTTP/1.0" 500 145
django.server | "GET / HTTP/1.1" 302 0
django.server | "GET /favicon.ico HTTP/1.1" 302 0
django.server | "GET /favicon.ico HTTP/1.1" 302 0
django.server | "GET /favicon.ico HTTP/1.1" 302 0
django.server | "GET /favicon.ico HTTP/1.1" 302 0
django.server | "GET /login/?next=/default/dashboard/ HTTP/1.1" 200 4516
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "GET /default/dashboard/ HTTP/1.1" 302 0
django.server | "POST /login/?next=/default/dashboard/ HTTP/1.0" 403 1019
django.server | "GET /favicon.ico HTTP/1.0" 500 145
django.server | "GET /login/?next=/default/dashboard/ HTTP/1.0" 200 4940
django.server | "GET /favicon.ico HTTP/1.0" 500 145
django.server | "POST /login/?next=/default/dashboard/ HTTP/1.0" 200 4884
django.server | "GET /favicon.ico HTTP/1.0" 500 145
django.server | "POST /login/?next=/default/dashboard/ HTTP/1.0" 200 4884
django.server | "GET /favicon.ico HTTP/1.0" 500 145
django.server | "POST /login/?next=/default/dashboard/ HTTP/1.0" 302 0
django.server | "GET /default/dashboard/ HTTP/1.0" 500 145
django.server | "GET /favicon.ico HTTP/1.0" 500 145

Steps To Reproduce

  1. update new version
  2. down all service
  3. restart service
  4. web error 500 when i login

Environment

- reNgine: 2.1.0
- OS: Ubuntu
- Python: 3.8.10
- Docker Engine: 20.10.21
- Docker Compose: 2.5
- Browser: Chrome Version 126.0.6478.127 (Official Build) (64-bit)

Anything else?

No response

@bagialuudan bagialuudan added the bug Something isn't working label Jul 2, 2024
Copy link

github-actions bot commented Jul 2, 2024

👋 Hi @bagialuudan,
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.

@yogeshojha
Copy link
Owner

Hi @bagialuudan can you down the service and restart them

make down && make up

@bagialuudan
Copy link
Author

bagialuudan commented Jul 3, 2024 via email

@bagialuudan
Copy link
Author

I think rengine-web has encountered an error. I set it to debug mode but still couldn't find the log. I forwarded the port to my machine without going through a proxy and still experienced a login error

@null-ref-0000
Copy link
Contributor

null-ref-0000 commented Jul 3, 2024

I get the same error after upgrading. Checked the logs ( make logs ) provides this error.

db-1 | 2024-07-03 11:52:31.459 UTC [650] ERROR: column startScan_scanhistory.initiated_by_id does not exist at character 434

From my end this appears to be the issue, that is causing the 500 error on the web.

So I tried to update the database by getting a shell on the web container and running the following.

root@a343ae5e23bd:/usr/src/app# python3 manage.py migrate
_ _ _
| \ | | ()
_ __ | | | __ _ _ _ __ ___
| '
/ _ \ . |/ _ | | '
\ / _
| | | __/ |\ | (
| | | | | | /
|_| _
|| _|_, ||| |_|__| v2.1.0
/ |
|
/

pikepdf._core | pikepdf C++ to Python logger bridge initialized
System check identified some issues:

WARNINGS:
startScan.EndPoint.techs: (fields.W340) null has no effect on ManyToManyField.
Operations to perform:
Apply all migrations: admin, auth, contenttypes, dashboard, django_celery_beat, recon_note, scanEngine, sessions, startScan, targetApp
Running migrations:
No migrations to apply.

But it did not update the database as expected.

@yogeshojha
Copy link
Owner

@bagialuudan @null-ref-0000 @m0ng3sh3ll

I found the root cause for both of these issues but far from finding a solution for it. The problem is that in 2.1.0 we introduced this field in Scans called initiated_by, meaning its a field to show who has initiated the scan.
That was not there in previous versions and there's been issue in django migration that the table schema does not have initiated_by.

I have tried everything to resolve this, but looks like no chance.

The only option would be to flush out all scan history, that means you will loose all the scans but targets will remain as it is.

you can use this command

sudo docker exec -it rengine-web-1 python3 manage.py migrate startScan zero

Please note that while targets will remain as it is, but the scan history will be flushed out, and app will continue to work

@m0ng3sh3ll
Copy link

@yogeshojha for my case, the solution showing resolved the problem. Tks.

@bagialuudan
Copy link
Author

@yogeshojha @null-ref-0000 @m0ng3sh3ll I found the root, because the database was too old, something might have been added to the database during the update, so when setting up the web, it mount the old database which caused the web to not load data. I have deleted and reinstalled the database and everything is fine now, you can try it

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