I am using the EB platform: Python 3.7 AL2 version 3.3.11, and all is working fine.
But, the troubleshooting comes when I try to upgrade both to a newer AL2 version (3.3.12) and to a newer Python version (3.8). The error happens on the "[app-deploy] - [StageApplication]":
eb-engine:
022/04/20 11:51:08.170326 [INFO] Executing instruction: StageApplication
2022/04/20 11:51:08.171215 [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2022/04/20 11:51:08.171232 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2022/04/20 11:51:08.208452 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2022/04/20 11:51:08.212657 [ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Error: chown /var/app/staging/venv/dev/lib/python3.8/collections: no such file or directory
The error specifically says:
[ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Error: chown /var/app/staging/venv/dev/lib/python3.8/collections: no such file or directory
I don't know why it goes there, instead of /var/app/venv/staging-LQM1lest/lib/python3.8 that is where I think it should go and where it is the virtual environment.
I can assure that the local /venv folder is ignored when deploying (following this related question https://stackoverflow.com/questions/61805345/aws-elastic-beanstalk-chown-pythonpath-error). Said that though, after connecting to the instance by ssh, I can see a venv folder in /var/app/staging/ containing a pyton3.8 sub folder. I am curious to know why this happens and what can I be doing wrong in the process
Thanks in advance!