This article provides a fix for the issue when you are getting deployment errors that are caused by incorrect commits to the repository of files/folders that shouldn’t have been added.
Adobe Commerce on cloud infrastructure (all versions)
You are getting deployment errors when you commit to the repository of files/folders. For example, the following error is caused due to an attempt to connect to the DB when it’s not currently available during the Build Phase:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for database.i
nternal failed: Name or service not known
In Abstract.php line 124:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for database.i
nternal failed: Name or service not known
In Abstract.php line 124:
PDO::__construct(): php_network_getaddresses: getaddrinfo for database.inte
rnal failed: Name or service not known
Certain files/folders shouldn’t be committed to the repository, as they cause a break in the deployment workflow.
Remove these files/folders from your repository if they are present:
app/etc/env.php
pub/media/catalog
vendor