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

internal error: D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(767): Value was null #38877

Closed
Gr8-Dane opened this issue May 22, 2024 · 34 comments · Fixed by microsoft/vcpkg-tool#1411
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@Gr8-Dane
Copy link

Received the following error:

internal error: D:\a_work\1\s\src\vcpkg\base\downloads.cpp(767): Value was null
Please open an issue at https://github.com/microsoft/vcpkg/issues/new?template=other-type-of-bug-report.md&labels=category:vcpkg-bug with detailed steps to reproduce the problem.

Details:

  • System: Windows 10 VM
  • IDE: Visual Studio Code
  • Compiler: CMAKE -> set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake"
    CACHE STRING "Vcpkg toolchain file")
  • Structure: submodule of project
  • Error Case: when configuring cmake
@autoantwort
Copy link
Contributor

Probably an old vcpkg-tool version. Update by git pull + ./bootstrap-vcpkg.bat

@Gr8-Dane
Copy link
Author

Gr8-Dane commented May 22, 2024

I did what you suggestion:

PS C:\***\vcpkg> git pull
Already up to date.

and still have the same issue @autoantwort

@autoantwort
Copy link
Contributor

What is the result of vcpkg --version?

@Gr8-Dane
Copy link
Author

vcpkg package management program version 2024-04-23-d6945642ee5c3076addd1a42c331bbf4cfc97457

@autoantwort
Copy link
Contributor

And what is the full log or the steps to reproduce?

@Gr8-Dane
Copy link
Author

Here is the output:

PS C:\Users\drich34\Documents\Work\Network\build> cmake ..
-- Running vcpkg install
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe
The following packages will be built and installed:
    utilities:x64-windows@0.0.1
Restored 0 package(s) from C:\Users\drich34\AppData\Local\vcpkg\archives in 166 us. Use --debug to see more details.
Installing 1/1 utilities:x64-windows@0.0.1...
Building utilities:x64-windows@0.0.1...
-- Note: utilities only supports static library linkage. Building static library.
-- Downloading https:/gitlab.gtri.gatech.edu/applied-systems-laboratory/utilities/-/archive/f663960fe910c1c665f07d34b4ba6d601bd10932/utilities-f663960fe910c1c665f07d34b4ba6d601bd10932.tar.gz -> applied-systems-laboratory-utilities-f663960fe910c1c665f07d34b4ba6d601bd10932.tar.gz...
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Trying to load bundleconfig from C:\Users\drich34\Documents\Work\Network\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: C:\Users\drich34\Documents\Work\Network\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Metrics enabled.
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
internal error: D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(767): Value was null
Please open an issue at https://github.com/microsoft/vcpkg/issues/new?template=other-type-of-bug-report.md&labels=category:vcpkg-bug with detailed steps to reproduce the problem.
[DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(767):
[DEBUG] Time in subprocesses: 0us
[DEBUG] Time in parsing JSON: 8us
[DEBUG] Time in JSON reader: 0us
[DEBUG] Time in filesystem: 3188us
[DEBUG] Time in loading ports: 0us
[DEBUG] Exiting after 62.6 ms (5050us)

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:32 (message):

      Failed to download file with error: 1
      If you are using a proxy, please check your proxy setting. Possible causes are:

      1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable
         to `https://address:port`. This is not correct, because `https://` prefix
         claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr
         , etc..) is an HTTP proxy. Try setting `http://address:port` to both
         HTTP_PROXY and HTTPS_PROXY instead.

      2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings
         set by your proxy software. See https://github.com/microsoft/vcpkg-tool/pull/77
         The value set by your proxy might be wrong, or have same `https://` prefix issue.

      3. Your proxy's remote server is out of service.

      If you've tried directly download the link, and believe this is not a temporary
      download server failure, please submit an issue at https://github.com/Microsoft/vcpkg/issues
      to report this upstream download server failure.


Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:270 (z_vcpkg_download_distfile_show_proxy_and_fail)
  scripts/cmake/vcpkg_from_gitlab.cmake:113 (vcpkg_download_distfile)
  ports/utilities/portfile.cmake:3 (vcpkg_from_gitlab)
  scripts/ports.cmake:175 (include)


error: building utilities:x64-windows failed with: BUILD_FAILED
Elapsed time to handle utilities:x64-windows: 235 ms
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
  https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+utilities
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?title=[utilities]+Build+error+on+x64-windows&body=Copy+issue+body+from+C%3A%2FUsers%2Fdrich34%2FDocuments%2FWork%2FNetwork%2Fbuild%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md

-- Running vcpkg install - failed
CMake Error at vcpkg/scripts/buildsystems/vcpkg.cmake:899 (message):
  vcpkg install failed.  See logs for more information:
  C:\Users\drich34\Documents\Work\Network\build\vcpkg-manifest-install.log
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:146 (include)
  CMakeLists.txt:7 (project)


-- Configuring incomplete, errors occurred!

@Gr8-Dane
Copy link
Author

steps to reproduce

  • clone vcpkg to repo
  • run installation
  • add set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" to cmakelists.txt
  • run cmake .. in build folder

@Gr8-Dane
Copy link
Author

I also added my custom package "utilities" to the port folder of vcpkg

@autoantwort
Copy link
Contributor

This is not a valid link: https:/gitlab.gtri.gatech.edu/applied-systems-laboratory/utilities/-/archive/f663960fe910c1c665f07d34b4ba6d601bd10932/utilities-f663960fe910c1c665f07d34b4ba6d601bd10932.tar.gz

@autoantwort
Copy link
Contributor

I guess the error Message should be better

@Gr8-Dane
Copy link
Author

hmm, okay thank you. I must have setup the vcpkg_from_gitlab incorrectly

@Cheney-W Cheney-W added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label May 23, 2024
@Gr8-Dane
Copy link
Author

@autoantwort I fixed the link issue and the code will download now, however I still get the same error

@autoantwort
Copy link
Contributor

Can you paste your log

@Gr8-Dane
Copy link
Author

PS C:\Users\drich34\Documents\Work\Network\build> cmake ..
-- Running vcpkg install
Detecting compiler hash for triplet x64-windows...
Compiler found: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe
The following packages will be built and installed:
utilities:x64-windows@0.0.1
Restored 0 package(s) from C:\Users\drich34\AppData\Local\vcpkg\archives in 173 us. Use --debug to see more details.
Installing 1/1 utilities:x64-windows@0.0.1...
Building utilities:x64-windows@0.0.1...
-- Note: utilities only supports static library linkage. Building static library.
-- Downloading https:/gitlab.gtri.gatech.edu/applied-systems-laboratory/utilities/-/archive/22ece035c1ba6c8b6e434585f535f8a282601d30/utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz -> applied-systems-laboratory-utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz...
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Trying to load bundleconfig from C:\Users\drich34\Documents\Work\Network\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: C:\Users\drich34\Documents\Work\Network\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt[DEBUG] Metrics enabled.
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
internal error: D:\a_work\1\s\src\vcpkg\base\downloads.cpp(767): Value was null
Please open an issue at https://github.com/microsoft/vcpkg/issues/new?template=other-type-of-bug-report.md&labels=category:vcpkg-bug with detailed steps to reproduce the problem.
[DEBUG] D:\a_work\1\s\src\vcpkg\base\downloads.cpp(767):
[DEBUG] Time in subprocesses: 0us
[DEBUG] Time in parsing JSON: 8us
[DEBUG] Time in JSON reader: 0us
[DEBUG] Time in filesystem: 4493us
[DEBUG] Time in loading ports: 0us
[DEBUG] Exiting after 67.2 ms (5262us)

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:32 (message):

  Failed to download file with error: 1
  If you are using a proxy, please check your proxy setting. Possible causes are:

  1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable
     to `https://address:port`. This is not correct, because `https://` prefix
     claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr
     , etc..) is an HTTP proxy. Try setting `http://address:port` to both
     HTTP_PROXY and HTTPS_PROXY instead.

  2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings
     set by your proxy software. See https://github.com/microsoft/vcpkg-tool/pull/77
     The value set by your proxy might be wrong, or have same `https://` prefix issue.

  3. Your proxy's remote server is out of service.

  If you've tried directly download the link, and believe this is not a temporary
  download server failure, please submit an issue at https://github.com/Microsoft/vcpkg/issues
  to report this upstream download server failure.

Call Stack (most recent call first):
scripts/cmake/vcpkg_download_distfile.cmake:270 (z_vcpkg_download_distfile_show_proxy_and_fail)
scripts/cmake/vcpkg_from_gitlab.cmake:113 (vcpkg_download_distfile)
ports/utilities/portfile.cmake:3 (vcpkg_from_gitlab)
scripts/ports.cmake:175 (include)

Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+utilities
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[utilities]+Build+error+on+x64-windows&body=Copy+issue+body+from+C%3A%2FUsers%2Fdrich34%2FDocuments%2FWork%2FNetwork%2Fbuild%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md

-- Running vcpkg install - failed
CMake Error at vcpkg/scripts/buildsystems/vcpkg.cmake:899 (message):
vcpkg install failed. See logs for more information:
C:\Users\drich34\Documents\Work\Network\build\vcpkg-manifest-install.log
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:146 (include)
CMakeLists.txt:7 (project)

-- Configuring incomplete, errors occurred!

@autoantwort
Copy link
Contributor

autoantwort commented May 23, 2024

Downloading https:/gitlab.gtri.gatech.edu/applied-systems-laboratory/utilities/-/archive/22ece035c1ba6c8b6e434585f535f8a282601d30/utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz

Same error, still not a valid url...
Must be https://

@Gr8-Dane
Copy link
Author

So I wonder if its because you have to have an account to download the code. I can download it just fine when I put in that URL

@Gr8-Dane
Copy link
Author

do you think that's the problem? How would I give access in vcpkg to get the code

@autoantwort
Copy link
Contributor

Per RFC 2396 it must be //. Probably browsers will fix that for you because it is a common mistake/typo

@autoantwort
Copy link
Contributor

I guess you are doing something wrong because the problem does not exists in this repo

@autoantwort
Copy link
Contributor

Can you show your portfile.cmake

@Gr8-Dane
Copy link
Author

Gr8-Dane commented May 23, 2024

I just updated the // and it still gives me the error

@Gr8-Dane
Copy link
Author

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_gitlab(
GITLAB_URL https://gitlab.gtri.gatech.edu
OUT_SOURCE_PATH SOURCE_PATH
REPO applied-systems-laboratory/utilities
REF 22ece035c1ba6c8b6e434585f535f8a282601d30
SHA512 0
HEAD_REF master
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME "utilities")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

@Gr8-Dane
Copy link
Author

I know that the SHA512 should be the hash and not 0 but I've read that I should set it to 0 and it will give me the correct hash, but the hash isn't showing up when i do the cmake build

@Gr8-Dane
Copy link
Author

@autoantwort thanks for your help so far! any further recommendations?

@autoantwort
Copy link
Contributor

I can not repo your problem. If I use your portfile I get

...
-- Downloading https://gitlab.gtri.gatech.edu/applied-systems-laboratory/utilities/-/archive/22ece035c1ba6c8b6e434585f535f8a282601d30/utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz -> applied-systems-laboratory-utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz...

@Gr8-Dane
Copy link
Author

oh so it works for you? hmmmmm, interesting. I'll try a few things then

@autoantwort
Copy link
Contributor

Yes it works for me

@Gr8-Dane
Copy link
Author

right now the thing I'm noticing is that the expected hash keeps changing. Every time I update it to the expected hash it says it expects a different one


Downloading https://gitlab.gtri.gatech.edu/applied-systems-laboratory/utilities/-/archive/22ece035c1ba6c8b6e434585f535f8a282601d30/utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz
[DEBUG] Trying to hash C:\Users\drich34\Documents\Work\TestVcpkg\vcpkg\downloads\applied-systems-laboratory-utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz.5816.part
[DEBUG] C:\Users\drich34\Documents\Work\TestVcpkg\vcpkg\downloads\applied-systems-laboratory-utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz.5816.part has hash 3bfc8521b34cbe785deef9a9278d25f5b5721a3b2b5e8e1d4815ac57c34d41f2006dd91f093e7f318657f93257387ea6784df0c0ef13d8f096cc41657b137083
error: Failed to download from mirror set
error: File does not have the expected hash:
url: https://gitlab.gtri.gatech.edu/applied-systems-laboratory/utilities/-/archive/22ece035c1ba6c8b6e434585f535f8a282601d30/utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz
File: C:\Users\drich34\Documents\Work\TestVcpkg\vcpkg\downloads\applied-systems-laboratory-utilities-22ece035c1ba6c8b6e434585f535f8a282601d30.tar.gz.5816.part
Expected hash: 52aa5eb8f5ef66c91047c4735db0acf3e7c22be5b124d38e00f906c84a63b9ebb23b2fbbb582bf7c210e013e5560bcd6834c8dbd57366cc0557a9a59cb46b43b
Actual hash: 3bfc8521b34cbe785deef9a9278d25f5b5721a3b2b5e8e1d4815ac57c34d41f2006dd91f093e7f318657f93257387ea6784df0c0ef13d8f096cc41657b137083

@autoantwort
Copy link
Contributor

@Gr8-Dane
Copy link
Author

If i put that into my browser, it downloads a tar.gz file, which I then unzip and find all the expected files and folders in

@Gr8-Dane
Copy link
Author

Gr8-Dane commented May 31, 2024

could this problem be due to the fact that the repo is password protected as part of my organization? perhaps I need to put some kind of sign-in functionality for vcpkg to access the repo?

@Gr8-Dane
Copy link
Author

also, my organization uses a vpn, could that be part of the problem?

@autoantwort
Copy link
Contributor

could this problem be due to the fact that the repo is password protected as part of my organization? perhaps I need to put some kind of sign-in functionality for vcpkg to access the repo?

Yeah. If you open the link in a private browser window you probably have to log in.

also, my organization uses a vpn, could that be part of the problem?

If you have no specific setup for your browser then windows should use it automatically

@autoantwort
Copy link
Contributor

You can pass AUTHORIZATION_TOKEN to vcpkg_from_gitlab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants