Project

Profile

Help

Maintenance: Planio will be observing a scheduled maintenance window this Sunday, November 10, 2024 from 20:00 UTC until 21:00 UTC to perform important network maintenance in our primary data center. Your Planio account will be unavailable for a few minutes during this maintenance window.

Issue #2703

closed

db-reset.sh when called during vagrant up isn't working

Added by fdobrovo over 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

The db-reset.sh doesn't properly work during provisioning this leads to unmigrated database after vagrant up. After that one have to be in virtualenv to make the script work.

TASK [dev : Initialize Pulp DB] ************************************************
changed: [dev] => {
    "changed": true, 
    "cmd": [
        "/home/vagrant/devel/pulp/app/pulp/app/db-reset.sh"
    ], 
    "delta": "0:00:01.063070", 
    "end": "2017-04-12 16:44:18.684091", 
    "invocation": {
        "module_args": {
            "_raw_params": "/home/vagrant/devel/pulp/app/pulp/app/db-reset.sh", 
            "_uses_shell": false, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": null, 
            "warn": true
        }, 
        "module_name": "command"
    }, 
    "rc": 0, 
    "start": "2017-04-12 16:44:17.621021", 
    "stderr": "Traceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management\nTraceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management\nTraceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management\nTraceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management", 
    "stdout": "~/devel/pulp/app/pulp/app ~\nPlatform 'migrations' dir already exists (/home/vagrant/devel/pulp/app/pulp/app/migrations)\nIf resetting the DB fails, migrations for pulp apps (including platform)\nmay need to be removed for the DB reset to succeed.\n~", 
    "stdout_lines": [
        "~/devel/pulp/app/pulp/app ~", 
        "Platform 'migrations' dir already exists (/home/vagrant/devel/pulp/app/pulp/app/migrations)", 
        "If resetting the DB fails, migrations for pulp apps (including platform)", 
        "may need to be removed for the DB reset to succeed.", 
        "~"
    ], 
    "warnings": []
}

stderr:

Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

Script:
https://github.com/pulp/pulp/blob/3.0-dev/app/pulp/app/db-reset.sh
Ansible task:
https://github.com/pulp/devel/blob/3.0-dev/ansible/roles/dev/tasks/main.yml

Debugged by:

ansible.verbose = "vvv"

Related issues

Blocks Pulp - Task #2742: As a developer, Pulp, Plugins, and python dependencies are installed into a single virtual environmentCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions
Actions #1

Updated by amacdona@redhat.com over 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com
Actions #2

Updated by ttereshc over 7 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by amacdona@redhat.com over 7 years ago

  • Blocks Task #2742: As a developer, Pulp, Plugins, and python dependencies are installed into a single virtual environment added

Added by amacdona@redhat.com over 7 years ago

Revision e072177e | View on GitHub

Pass virtualenv to db-reset

Since Django is installed in a virtual environment, it should should be activated before manage.py commands are run.

closes #2708

Actions #4

Updated by amacdona@redhat.com over 7 years ago

  • Status changed from ASSIGNED to POST
Actions #5

Updated by amacdona@redhat.com over 7 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #7

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #8

Updated by bmbouter almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF