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

docfx download throws exception #2805

Closed
bitbonk opened this issue May 22, 2018 · 3 comments
Closed

docfx download throws exception #2805

bitbonk opened this issue May 22, 2018 · 3 comments
Assignees
Labels
bug A bug to fix dotnet Generate .NET API reference docs fundamental Engineering system and core components
Milestone

Comments

@bitbonk
Copy link
Contributor

bitbonk commented May 22, 2018

DocFX Version Used:
docfx 2.35.4.0

Steps to Reproduce:

  1. run docfx download -x https://docs.microsoft.com/dotnet/xrefmap.yml

Expected Behavior:
The xrefmap is downloaded so I can build my API documentation even when the internet is broken

Actual Behavior:

[18-05-22 09:39:30.415]Error:System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Phase name cannot be null or white space.
Parameter name: fileName
   at Microsoft.DocAsCode.Common.LoggerFileScope..ctor(String fileName)
   at Microsoft.DocAsCode.Build.Engine.XRefArchiveBuilder.<DownloadAsync>d__3.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.DocAsCode.SubCommands.DownloadCommand.Exec(SubCommandRunningContext context)
   at Microsoft.DocAsCode.Program.ExecSubCommand(String[] args)
---> (Inner Exception #0) System.ArgumentException: Phase name cannot be null or white space.
Parameter name: fileName
   at Microsoft.DocAsCode.Common.LoggerFileScope..ctor(String fileName)
   at Microsoft.DocAsCode.Build.Engine.XRefArchiveBuilder.<DownloadAsync>d__3.MoveNext()<---

[18-05-22 09:39:30.424]Info:Completed in 46,1122 milliseconds


Build failed.
[18-05-22 09:39:30.431]Error:System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Phase name cannot be null or white space.
Parameter name: fileName
   at Microsoft.DocAsCode.Common.LoggerFileScope..ctor(String fileName)
   at Microsoft.DocAsCode.Build.Engine.XRefArchiveBuilder.<DownloadAsync>d__3.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.DocAsCode.SubCommands.DownloadCommand.Exec(SubCommandRunningContext context)
   at Microsoft.DocAsCode.Program.ExecSubCommand(String[] args)
---> (Inner Exception #0) System.ArgumentException: Phase name cannot be null or white space.
Parameter name: fileName
   at Microsoft.DocAsCode.Common.LoggerFileScope..ctor(String fileName)
   at Microsoft.DocAsCode.Build.Engine.XRefArchiveBuilder.<DownloadAsync>d__3.MoveNext()<---

        0 Warning(s)
        1 Error(s)
@superyyrrzz
Copy link
Contributor

try this: docfx download -x https://docs.microsoft.com/dotnet/xrefmap.yml xrefmap.zip

I agree the error message should be improved...

@superyyrrzz superyyrrzz added the bug A bug to fix label May 25, 2018
@vwxyzh vwxyzh self-assigned this May 28, 2018
@bitbonk
Copy link
Contributor Author

bitbonk commented May 30, 2018

docfx download -x https://docs.microsoft.com/dotnet/xrefmap.yml xrefmap.zip worked.

But it seems that docfx cannot handle this file when building.

I renamed that file to docs.microsoft.com.20180530.zip and put it on out local help server.
this is now in my docfx,json

"xref": [
      "http://our.intranet.local/help/SomeLib/xrefmap.yml",
      "http://our.intranet.local/help/xrefmaps/docs.microsoft.com.20180530.zip"

When I build it using

docfx -p 93200 --serve

I get the following error:

[18-05-30 01:38:21.429]Warning:[BuildCommand]Unable to download xref map file from "http://our.intranet.local/help/xrefmaps/docs.microsoft.com.20180530.zip", details: (Line: 1, Col: 6, Idx: 5) - (Line: 1, Col: 7, Idx: 6): While scanning for the next token, find character that cannot start any token.

Could it be that zip files only work on file paths (.e.g. "foo/msdn.4.5.2.zip") but not when served via HTTP? This limitation doesn't make any sense to me.

@vwxyzh
Copy link
Contributor

vwxyzh commented Jun 4, 2018

@bitbonk currently zip files are only supported in local.
If file server is available, you can try following:

"xref": ["file://your_machine_name/folder/docs.microsoft.com.20180530.zip"]

@vwxyzh vwxyzh added this to the v2.37 milestone Jun 7, 2018
@yufeih yufeih added the fundamental Engineering system and core components label Dec 15, 2022
@yufeih yufeih added the dotnet Generate .NET API reference docs label Feb 6, 2023
@yufeih yufeih closed this as completed in 23f8cbe Nov 29, 2023
p-kostov pushed a commit to ErpNetDocs/docfx that referenced this issue Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix dotnet Generate .NET API reference docs fundamental Engineering system and core components
Projects
None yet
Development

No branches or pull requests

4 participants