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

Azure Devops Exception when not using ADO #1143

Open
MarkRx opened this issue Aug 14, 2024 · 2 comments
Open

Azure Devops Exception when not using ADO #1143

MarkRx opened this issue Aug 14, 2024 · 2 comments
Labels

Comments

@MarkRx
Copy link
Contributor

MarkRx commented Aug 14, 2024

In a locked down container environment (a security practice where all files are read only within a container and only volumes can be written to) a server fails to boot due to an ADO error even when not using ADO. It appears to be because ADO attempts to write ./azure-devops on during initialization.

line

Fix could be to enhance the delayed exception handling to handle any exception then rethrow it here

traceback (most recent call last):
File "/app/pr_agent/servers/bitbucket_server_webhook.py", line 15, in
from pr_agent.agent.pr_agent import PRAgent
File "/app/pr_agent/agent/pr_agent.py", line 10, in
from pr_agent.git_providers.utils import apply_repo_settings
File "/app/pr_agent/git_providers/init.py", line 9, in
from pr_agent.git_providers.azuredevops_provider import AzureDevopsProvider
File "/app/pr_agent/git_providers/azuredevops_provider.py", line 21, in
from azure.devops.connection import Connection
File "/usr/local/lib/python3.11/site-packages/azure/devops/connection.py", line 9, in
from ._file_cache import RESOURCE_CACHE as RESOURCE_FILE_CACHE
File "/usr/local/lib/python3.11/site-packages/azure/devops/_file_cache.py", line 128, in
DEFAULT_CACHE_DIR = get_cache_dir()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/devops/_file_cache.py", line 118, in get_cache_dir
os.makedirs(azure_devops_cache_dir)
File "", line 215, in makedirs
File "", line 215, in makedirs
File "", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/.azure-devops'

@MarkRx
Copy link
Contributor Author

MarkRx commented Aug 14, 2024

Looks like I can workaround this by setting AZURE_DEVOPS_CACHE_DIR to a bogus volume that the execution user has write access to. code

@mrT23
Copy link
Collaborator

mrT23 commented Aug 22, 2024

ok.

you are welcome to open a PR to update the documentation with this trick if you think its necessary
https://pr-agent-docs.codium.ai/installation/azure/#azure-devops-webhook

@mrT23 mrT23 added the answered label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants