Skip to content

Fix doc release crash from py2docfx 0.1.23 missing logs directory#45228

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-doc-release-logger-error
Draft

Fix doc release crash from py2docfx 0.1.23 missing logs directory#45228
Copilot wants to merge 2 commits intomainfrom
copilot/fix-doc-release-logger-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

py2docfx 0.1.23 (introduced in #44110) attempts to read logs/log.txt during error cleanup but throws FileNotFoundError when the directory doesn't exist, masking the actual error and breaking the documentation release pipeline.

Changes

  • Create logs directory in temp directory before invoking py2docfx
  • Run py2docfx from temp directory using Push-Location/Pop-Location so it finds the logs directory in current working directory
  • Ensures proper cleanup via finally block
# Create logs directory in temp location
$outputLogsDir = New-Item -ItemType Directory -Path (Join-Path $outputRoot "logs") -Force

# Run py2docfx from temp directory
Push-Location $outputRoot
try {
  $pyOutput = python -u -m py2docfx --param-file-path $outputJsonFile -o $outputDocsDir 2>&1
  # ... error handling
}
finally {
  Pop-Location
}

This unblocks the "Apply Documentation Updates" pipeline stage and surfaces actual errors instead of the misleading FileNotFoundError.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/44110
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • pypi.org
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
    • Triggering command: /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/pip pip index versions py2docfx (dns block)
    • Triggering command: /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python3 python3 -c import urllib.request, json; data = json.loads(urllib.request.urlopen('REDACTED').read()); print('Latest:', data['info']['version']); print('Releases:', sorted(data['releases'].keys(), reverse=True)[:10]) (dns block)
  • scanning-api.github.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Doc release is crashing with logger error</issue_title>
<issue_description>This error is definitely introduced by the merge of #44110

Visible here

Failed during release stage Apply Documentation Updates

2026-02-17T20:08:39.4818170Z ##[section]Starting: Apply Documentation Updates
2026-02-17T20:08:39.4824829Z ==============================================================================
2026-02-17T20:08:39.4825080Z Task         : PowerShell
2026-02-17T20:08:39.4825350Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2026-02-17T20:08:39.4825597Z Version      : 2.268.1
2026-02-17T20:08:39.4825809Z Author       : Microsoft Corporation
2026-02-17T20:08:39.4826001Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2026-02-17T20:08:39.4826272Z ==============================================================================
2026-02-17T20:08:39.6302216Z Generating script.
2026-02-17T20:08:39.6308952Z ========================== Starting Command Output ===========================
2026-02-17T20:08:39.6320855Z [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/mnt/vss/_work/_temp/709d6f48-29b0-429e-982d-8b126c988800.ps1'
2026-02-17T20:08:40.1083074Z Validating the packages...
2026-02-17T20:08:40.1136763Z Executing: which python
2026-02-17T20:08:40.1295200Z /opt/hostedtoolcache/Python/3.11.14/x64/bin/python
2026-02-17T20:08:40.1299820Z 
2026-02-17T20:08:40.1300127Z 
2026-02-17T20:08:40.1300553Z Executing: python -m pip freeze --all
2026-02-17T20:08:40.3652691Z alabaster==0.7.16
2026-02-17T20:08:40.3653704Z babel==2.18.0
2026-02-17T20:08:40.3656293Z certifi==2026.1.4
2026-02-17T20:08:40.3659468Z charset-normalizer==3.4.4
2026-02-17T20:08:40.3662380Z docutils==0.19
2026-02-17T20:08:40.3664720Z idna==3.11
2026-02-17T20:08:40.3667259Z imagesize==1.4.1
2026-02-17T20:08:40.3669576Z Jinja2==3.1.6
2026-02-17T20:08:40.3673235Z MarkupSafe==3.0.3
2026-02-17T20:08:40.3675085Z packaging==26.0
2026-02-17T20:08:40.3676970Z pip==25.3
2026-02-17T20:08:40.3679453Z py2docfx==0.1.23
2026-02-17T20:08:40.3681864Z Pygments==2.19.2
2026-02-17T20:08:40.3684656Z PyYAML==6.0.3
2026-02-17T20:08:40.3687441Z requests==2.32.5
2026-02-17T20:08:40.3689939Z setuptools==79.0.1
2026-02-17T20:08:40.3692478Z snowballstemmer==3.0.1
2026-02-17T20:08:40.3695056Z Sphinx==6.1.3
2026-02-17T20:08:40.3697424Z sphinxcontrib-applehelp==2.0.0
2026-02-17T20:08:40.3699687Z sphinxcontrib-devhelp==2.0.0
2026-02-17T20:08:40.3702348Z sphinxcontrib-htmlhelp==2.1.0
2026-02-17T20:08:40.3704912Z sphinxcontrib-jsmath==1.0.1
2026-02-17T20:08:40.3707225Z sphinxcontrib-qthelp==2.0.0
2026-02-17T20:08:40.3709487Z sphinxcontrib-serializinghtml==2.0.0
2026-02-17T20:08:40.3711742Z urllib3==2.6.3
2026-02-17T20:08:40.3714402Z wheel==0.46.3
2026-02-17T20:08:40.3716508Z 
2026-02-17T20:08:40.3716764Z 
2026-02-17T20:08:40.4075155Z {
2026-02-17T20:08:40.4075901Z   "packages": [
2026-02-17T20:08:40.4076325Z     {
2026-02-17T20:08:40.4076754Z       "package_info": {
2026-02-17T20:08:40.4077235Z         "name": "azure-appconfiguration-provider",
2026-02-17T20:08:40.4077717Z         "install_type": "pypi",
2026-02-17T20:08:40.4078191Z         "prefer_source_distribution": "true",
2026-02-17T20:08:40.4078653Z         "version": "==2.4.0",
2026-02-17T20:08:40.4079215Z         "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/"
2026-02-17T20:08:40.4079595Z       },
2026-02-17T20:08:40.4079842Z       "exclude_path": [
2026-02-17T20:08:40.4080111Z         "test*",
2026-02-17T20:08:40.4080373Z         "example*",
2026-02-17T20:08:40.4080636Z         "sample*",
2026-02-17T20:08:40.4080891Z         "doc*"
2026-02-17T20:08:40.4081135Z       ],
2026-02-17T20:08:40.4081399Z       "extension_config": {
2026-02-17T20:08:40.4081685Z         "autodoc_default_options": {
2026-02-17T20:08:40.4082239Z           "inherited-members": 1
2026-02-17T20:08:40.4082590Z         }
2026-02-17T20:08:40.4082826Z       }
2026-02-17T20:08:40.4083076Z     }
2026-02-17T20:08:40.4083323Z   ]
2026-02-17T20:08:40.4083556Z }
2026-02-17T20:08:40.4090045Z Executing: python -u -m py2docfx --param-file-path /tmp/hvxefsky.vay/azure-appconfiguration-provider.json -o /tmp/hvxefsky.vay/docsOutput
2026-02-17T20:08:52.3847454Z Traceback (most recent call last):
2026-02-17T20:08:52.3848862Z   File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/py2docfx/__main__.py", line 123, in main
2026-02-17T20:08:52.3849568Z     await donwload_package_generate_documents(
2026-02-17T20:08:52.3851665Z   File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/py2docfx/__main__.py", li...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes Azure/azure-sdk-for-python#45227

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix crashing issue with doc release logger Fix doc release crash from py2docfx 0.1.23 missing logs directory Feb 17, 2026
Copilot AI requested a review from scbedd February 17, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments