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

"web/manage.py migrate" end with "no migrations to apply" #2363

Open
6 tasks done
superonion7890 opened this issue Oct 20, 2024 · 3 comments
Open
6 tasks done

"web/manage.py migrate" end with "no migrations to apply" #2363

superonion7890 opened this issue Oct 20, 2024 · 3 comments

Comments

@superonion7890
Copy link

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I did read the README!
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)
  • I have read and checked all configs (with all optional parts)

Expected Behavior

The migrations is real applied and the status "You have xx unapplied migration(s)" is gone

Current Behavior

I'm running poetry run python3 web/manage.py migrate but the migrations is not applied and I get message "No migrations to apply"

Steps to Reproduce

  1. sudo systemctl restart cape*
  2. sudo systemctl status cape-web.serice and the message "You have 33 unapplied migration(s)" shown
  3. poetry run python3 web/manage.py migrate and the message "No migrations to apply" shown
  4. poetry run python3 web/manage.py migrate again and still show the same message

Context

Question Answer
Architecture Nested virtualization
OS version Ubuntu Desktop 22.04.5 (VMware Guest)
RAM 20GB
Storage 160GB
RAM 20GB
CAPEv2 version October 18, 2024
Python3 version 3.10.12
poetry version 1.8.4
django version (in poetry) 4.2.16

Failure Logs

cape@cape:/opt/CAPEv2$ sudo systemctl status cape-web.service 
● cape-web.service - CAPE WSGI app
     Loaded: loaded (/lib/systemd/system/cape-web.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2024-10-20 12:27:16 UTC; 5s ago
       Docs: https://github.com/kevoreilly/CAPEv2
   Main PID: 7369 (python)
      Tasks: 3 (limit: 23849)
     Memory: 476.2M
        CPU: 3.800s
     CGroup: /system.slice/cape-web.service
             ├─7369 /home/cape/.cache/pypoetry/virtualenvs/capev2-t2x27zRb-py3.10/bin/python manage.py runserver_plus 0.0.0.0:8000 --traceback --keep-meta-shutdown
             └─7538 /home/cape/.cache/pypoetry/virtualenvs/capev2-t2x27zRb-py3.10/bin/python manage.py runserver_plus 0.0.0.0:8000 --traceback --keep-meta-shutdown

Okt 20 12:27:19 cape python3[7538]: INFO:modules.processing.network:Loading maxmind database from /opt/CAPEv2/modules/processing/../../data/GeoLite2-Country.mmdb
Okt 20 12:27:19 cape python3[7538]: System check identified no issues (3 silenced).
Okt 20 12:27:20 cape python3[7538]: You have 33 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): account, admin, a>
Okt 20 12:27:20 cape python3[7538]: Run 'python manage.py migrate' to apply them.
Okt 20 12:27:20 cape python3[7538]: Django version 4.2.16, using settings 'web.settings'
Okt 20 12:27:20 cape python3[7538]: Development server is running at http://0.0.0.0:8000/
Okt 20 12:27:20 cape python3[7538]: Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
Okt 20 12:27:20 cape python3[7538]: Quit the server with CONTROL-C.
Okt 20 12:27:20 cape python3[7538]:  * Debugger is active!
Okt 20 12:27:20 cape python3[7538]:  * Debugger PIN: 545-112-931

cape@cape:/opt/CAPEv2$ poetry run python3 web/manage.py migrate
INFO:modules.processing.network:Loading maxmind database from /opt/CAPEv2/modules/processing/../../data/GeoLite2-Country.mmdb
Operations to perform:
  Apply all migrations: account, admin, auth, authtoken, contenttypes, openid, sessions, sites, socialaccount, users
Running migrations:
  No migrations to apply.

cape@cape:/opt/CAPEv2$ poetry run python3 web/manage.py showmigrations --list
INFO:modules.processing.network:Loading maxmind database from /opt/CAPEv2/modules/processing/../../data/GeoLite2-Country.mmdb
account
 [X] 0001_initial
 [X] 0002_email_max_length
admin
 [X] 0001_initial
 [X] 0002_logentry_remove_auto_add
 [X] 0003_logentry_add_action_flag_choices
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length
 [X] 0009_alter_user_last_name_max_length
 [X] 0010_alter_group_name_max_length
 [X] 0011_update_proxy_permissions
 [X] 0012_alter_user_first_name_max_length
authtoken
 [X] 0001_initial
 [X] 0002_auto_20160226_1747
 [X] 0003_tokenproxy
 [X] 0004_alter_tokenproxy_options
contenttypes
 [X] 0001_initial
 [X] 0002_remove_content_type_name
openid
 [X] 0001_initial
sessions
 [X] 0001_initial
sites
 [X] 0001_initial
 [X] 0002_alter_domain_unique
socialaccount
 [X] 0001_initial
 [X] 0002_token_max_lengths
 [X] 0003_extra_data_default_dict
users
 [X] 0001_initial
 [X] 0002_reports
 [X] 0003_rename_field_subscription

image
image

@superonion7890 superonion7890 changed the title "web/manage.py migrate" end with "no migrations to apply "web/manage.py migrate" end with "no migrations to apply" Oct 20, 2024
@doomedraven
Copy link
Collaborator

Do you restart web after migration?

@superonion7890
Copy link
Author

Do you restart web after migration?

Yes, Yes, I have restarted the service, but the status "You have 33 unapplied migration(s) is still shown.

@doomedraven
Copy link
Collaborator

just tested on new server, i can't reproduce it %)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants