Problems fetching artifact from another build

trejkaz's Avatar


15 May, 2018 12:14 AM

I was trying to fetch a file yesterday which definitely exists, by doing this:

  - appveyor DownloadFile ""

But of course it doesn't fetch the file, and the appveyor tool provides absolutely no useful output to diagnose what went wrong. (What would have helped: if it printed out the URL it was trying to fetch, I would have seen the escaping problem.)

So after switching to curl to hopefully get some better diagnostics, I eventually arrived at:

  - curl -fLv -o ""

This hits the first URL, which gives me a 302, and then the second URL gives me a 404. You can see that result here:

When I visit the URL it got redirected to, indeed it was 404. So it's as if something in the appveyor backend generated me the wrong URL for my request. When I visited the original URL in my browser, though, it downloaded the file. So at this point, I have no idea why the build environment is finding it so hard to download a file.

I have tried with and without escaping of the slashes in the artifact URL and nothing has worked so far, so I guess I'm resorting to asking how this is supposed to work.

Side-question: Is it possible to have the leading subfolders stripped from artifact paths? It would make builds more stable in the future, as the path to the subfolder could be renamed at any point.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 15 May, 2018 04:06 AM

    Ilya Finkelshteyn's Avatar

    Please check this discussion for explanation and solutions.

    Also this blog post contains good example of downloading artifacts from different project.

    Regarding side question, it would be great if you create separate issue, with specific build example.

  2. 2 Posted by trejkaz on 15 May, 2018 04:12 AM

    trejkaz's Avatar

    So, I have had a read, and the one thing that stands out is that everyone is worrying about authorisation tokens. Is it the case that, if I don't have an authorisation token, I just can't download artifacts? If this is the case, is there a common workaround to avoid needing that?

    Both projects are public, both on GitHub and on AppVeyor, so I didn't expect to need such things.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 16 May, 2018 07:20 AM

    Ilya Finkelshteyn's Avatar

    If you call API, you still have to authorize. Please see this build and YAML below, created to do exactly what you need. Sure you have to use your own token and use it as a secure variable.

    version: 1.0.{build}
    - Release
    - Debug
      token: 14iltqlbh3um0c0ppj0h
    - ps: Invoke-RestMethod -Method Get -Uri "$$env:Configuration" -OutFile ".\LibVRInputEmulator-$" -Headers @{ "Authorization" = "Bearer $env:token" }
    - cmd: dir *zip
  4. 4 Posted by trejkaz on 17 May, 2018 04:03 AM

    trejkaz's Avatar

    At this point, then, I think it will be easier to just inline the first project's build into the second project's build.

    There were various other errors that came up while trying to reuse the first project's build products anyway, which were beyond my knowledge of Windows-specific build issues. e.g., I didn't know that you can't link libraries from multiple versions of the compiler together, which in itself ruins most of my plans to share one project's builds with the other. One project wanted VS 2015 and the other wanted 2017, and linking the two together was apparently impossible. So the second project would have to rebuild the entire thing anyway, at which point I figured I would just give up trying to share artifacts.

  5. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:28 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac