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

Fails when installing packages #391

Open
misilot opened this issue Feb 15, 2024 · 4 comments · May be fixed by #397
Open

Fails when installing packages #391

misilot opened this issue Feb 15, 2024 · 4 comments · May be fixed by #397

Comments

@misilot
Copy link
Contributor

misilot commented Feb 15, 2024

This task is failing when trying to install with the following task https://github.com/artefactual-labs/ansible-archivematica-src/blob/stable/1.15.x/tasks/install-packages.yml#L8-L13

This is on Ubuntu 22.04LTS

TASK [artefactual.archivematica-src : Install/Upgrade Debian packages: Ansible dependencies] *************************************************************************************************************************

fatal: [test-arc22]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_change_held_packages": false,
            "allow_downgrade": false,
            "allow_unauthenticated": false,
            "autoclean": false,
            "autoremove": false,
            "cache_valid_time": 0,
            "clean": false,
            "deb": null,
            "default_release": null,
            "dpkg_options": "force-confdef,force-confold",
            "fail_on_autoremove": false,
            "force": false,
            "force_apt_get": false,
            "install_recommends": null,
            "lock_timeout": 60,
            "name": [
                "acl",
                "python3-pycurl",
                "python3-setuptools",
                "git",
                "python3-mysqldb",
                "sqlite3",
                "ca-certificates"
            ],
            "only_upgrade": false,
            "package": [
                "acl",
                "python3-pycurl",
                "python3-setuptools",
                "git",
                "python3-mysqldb",
                "sqlite3",
                "ca-certificates"
            ],
            "policy_rc_d": null,
            "purge": false,
            "state": "{'code': 16, 'name': 'running'}",
            "update_cache": null,
            "update_cache_retries": 5,
            "update_cache_retry_max_delay": 12,
            "upgrade": "no"
        }
    },
    "msg": "value of state must be one of: absent, build-dep, fixed, latest, present, got: {'code': 16, 'name': 'running'}"
}

For some reason the status is getting {'code': 16, 'name': 'running'} instead of another value.

Is state defined somewhere else? I tried greping but did not see it.

Adding state: latest to https://github.com/artefactual-labs/ansible-archivematica-src/blob/stable/1.15.x/tasks/main.yml#L122-L128 seemed to have fixed it at least for us locally.

Also had to add it to this file https://github.com/artefactual-labs/ansible-archivematica-src/blob/stable/1.15.x/tasks/ss-osdeps.yml#L66-L75

Now stuck on this step

TASK [artefactual.archivematica-src : Create virtualenv and install pip-tools] ***************************************************************************************************************************************
fatal: [test-arc22]: FAILED! => {"changed": false, "cmd": ["/usr/share/archivematica/virtualenvs/archivematica-storage-service/bin/pip3", "install", "pip==21.3.1", "pip-tools==6.4.0"], "msg": "\n:stderr: Could not find platform independent libraries <prefix>\nCould not find platform dependent libraries <exec_prefix>\nConsider setting $PYTHONHOME to <prefix>[:<exec_prefix>]\nFatal Python error: Py_Initialize: Unable to get the locale encoding\nModuleNotFoundError: No module named 'encodings'\n\nCurrent thread 0x00007fc916c74740 (most recent call first):\n"}

@misilot
Copy link
Contributor Author

misilot commented Feb 15, 2024

another place I needed to adjust

https://github.com/artefactual-labs/ansible-archivematica-src/blob/stable/1.15.x/tasks/pipeline-osdeps.yml#L99-L115

re: the virtualenv step above.

I just deleted everything in the virtualenv directory, figuring Ansible will recreate it

@mamedin
Copy link
Contributor

mamedin commented Feb 20, 2024

Sorry, we should use a different variable name, instead "state"

In your inventory or playbooks you have defined:

state:
  - code: 16
    name: "running"

And when calling the following, it is not using the default value (latest)

https://github.com/artefactual-labs/ansible-archivematica-src/blob/stable/1.15.x/tasks/install-packages.yml#L8-L13

That's the reason because it fails to you and it works for us.

We are going to change that variable name, and set less generic one.

@misilot
Copy link
Contributor Author

misilot commented Feb 20, 2024

Hmm, I can't find anything in my inventory or playbook that defines: "state", "16" or "running"

@misilot
Copy link
Contributor Author

misilot commented Feb 21, 2024

Ok, so I found it. It looks like it's coming from the aws_ec2 inventory plugin we use

https://docs.ansible.com/ansible/latest/collections/amazon/aws/aws_ec2_inventory.html

or more specifically the awscli https://github.com/aws/aws-cli/blob/develop/awscli/examples/lightsail/get-instance.rst you can see the state variable defined as an example :(

misilot added a commit to misilot/ansible-archivematica-src that referenced this issue May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants