Search code examples
conan

Conan cannot find package id from new build server


I am consuming with Conan a project from the artifactory.

The artifact was built in my Jenkins pipeline and was uploaded to the artifactory.

I got 2 build servers, I want to move from the old one to the new one.

When I am consuming the artifact that was built in the new build server I am getting the following error:

[2020-10-06T14:49:07.485Z] Requirements

[2020-10-06T14:49:07.485Z]     ext_TPC/11.8.128@prod/master from 'conan-extTPC' - Downloaded

[2020-10-06T14:49:07.485Z]     ext_cli_plugins/11.800.30@prod/master from 'conan-CliPlugins' - Downloaded

[2020-10-06T14:49:07.485Z]     ext_dotnet_plugins/11.800.44@prod/master from 'conan-DotNetPlugins' - Downloaded

[2020-10-06T14:49:07.485Z] Packages

[2020-10-06T14:49:07.485Z]     ext_TPC/11.8.128@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Missing

[2020-10-06T14:49:07.485Z]     ext_cli_plugins/11.800.30@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Download

[2020-10-06T14:49:07.485Z]     ext_dotnet_plugins/11.800.44@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Download

[2020-10-06T14:49:07.485Z] 

[2020-10-06T14:49:07.485Z] Installing (downloading, building) binaries...

[2020-10-06T14:49:07.485Z] 

[2020-10-06T14:49:07.485Z] ERROR: Missing binary: ext_TPC/11.8.128@prod/master:63da998e3642b50bee33f4449826b2d623661505

[2020-10-06T14:49:07.485Z] ext_TPC/11.8.128@prod/master: WARN: Can't find a 'ext_TPC/11.8.128@prod/master' package for the specified settings, options and dependencies:

[2020-10-06T14:49:07.485Z] - Settings: arch=x86_64, build_type=Release, compiler=Visual Studio, compiler.runtime=MD, compiler.version=14, os=Windows

[2020-10-06T14:49:07.485Z] - Options: 

[2020-10-06T14:49:07.485Z] - Dependencies: 

[2020-10-06T14:49:07.485Z] - Requirements: 

[2020-10-06T14:49:07.485Z] - Package ID: 63da998e3642b50bee33f4449826b2d623661505

[2020-10-06T14:49:07.485Z] 

[2020-10-06T14:49:07.485Z] ERROR: Missing prebuilt package for 'ext_TPC/11.8.128@prod/master'

[2020-10-06T14:49:07.485Z] Try to build it from sources with "--build ext_TPC"

[2020-10-06T14:49:07.485Z] Or read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package"

[2020-10-06T14:49:07.485Z] 

script returned exit code 1

This is the command that I am running from the BAT file:

"conan install Scripts\NotCppConanFile.py -s os=Windows -s os_build=Windows -s arch=%ARCH% -s arch_build=%ARCH% -s build_type=%CONFIG% -s compiler="Visual Studio" -s compiler.version=14 -s compiler.runtime=%COMPILER_RUNTIME%
@IF NOT %ERRORLEVEL% == 0 EXIT /b %ERRORLEVEL%"
The Conan upload command: "conan upload ext_TPC/%PACKAGE_VERSION% --all -r=extTPC-conan --confirm"

And thats the output of the upload:

"[2020-10-05T23:37:35.088Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>conan export-pkg ./Scripts prod/master -f  

[2020-10-05T23:37:36.064Z] Auto detecting your dev setup to initialize the default profile (c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\profiles\default)

[2020-10-05T23:37:36.335Z] Found Visual Studio 15

[2020-10-05T23:37:36.335Z] Default settings

[2020-10-05T23:37:36.335Z]  os=Windows

[2020-10-05T23:37:36.335Z]  os_build=Windows

[2020-10-05T23:37:36.335Z]  arch=x86_64

[2020-10-05T23:37:36.335Z]  arch_build=x86_64

[2020-10-05T23:37:36.335Z]  compiler=Visual Studio

[2020-10-05T23:37:36.335Z]  compiler.version=15

[2020-10-05T23:37:36.335Z]  build_type=Release

[2020-10-05T23:37:36.335Z] *** You can change them in c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\profiles\default ***

[2020-10-05T23:37:36.335Z] *** Or override with -s compiler='other' -s ...s***

[2020-10-05T23:37:36.335Z] 

[2020-10-05T23:37:36.335Z] 

[2020-10-05T23:37:36.335Z] Exporting package recipe

[2020-10-05T23:37:36.335Z] ext_TPC/11.8.128@prod/master: A new conanfile.py version was exported

[2020-10-05T23:37:36.335Z] ext_TPC/11.8.128@prod/master: Folder: c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\data\ext_TPC\11.8.128\prod\master\export

[2020-10-05T23:37:36.336Z] ext_TPC/11.8.128@prod/master: Exported revision: b4153452b7268b78be94d8acdfd58e5a

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Forced build from source

[2020-10-05T23:37:36.697Z] Packaging to 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Generating the package

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Package folder c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\data\ext_TPC\11.8.128\prod\master\package\6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Calling package()

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.txt' file: 3rdPartyLicense.txt

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 9 '.dll' files

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.exe' file: CyberArk.TPC.exe

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.config' file: CyberArk.TPC.exe.config

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Package '6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7' created

[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Created package revision d5a1027449330f6e032dadf415327f0c

[2020-10-05T23:37:36.697Z] [HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'url'. It is recommended to add it as attribute

[2020-10-05T23:37:36.697Z] [HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'license'. It is recommended to add it as attribute

[2020-10-05T23:37:36.697Z] 

[2020-10-05T23:37:36.697Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>REM **** the package to artifactory... 

[2020-10-05T23:37:36.697Z] 

[2020-10-05T23:37:36.697Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>conan upload ext_TPC/11.8.128 --all -r=extTPC-conan --confirm 

[2020-10-05T23:37:37.666Z] Uploading to remote 'extTPC-conan':

[2020-10-05T23:37:37.666Z] 
Uploading ext_TPC/11.8.128@prod/master to remote 'extTPC-conan'                          

[2020-10-05T23:37:37.928Z] 
Uploading conanfile.py                                                
Uploading conanmanifest.txt                                           

[2020-10-05T23:37:37.928Z] 

[2020-10-05T23:37:37.928Z] 
Uploaded conan recipe 'ext_TPC/11.8.128@prod/master' to 'extTPC-conan': https://ca-dev-artifactory/artifactory/api/conan/extTPC-conan-latest-local

[2020-10-05T23:37:37.928Z] 
Uploading package 1/1: 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7 to 'extTPC-conan'        

[2020-10-05T23:37:37.928Z] Compressing package...

[2020-10-05T23:37:41.719Z] [==================================================]

[2020-10-05T23:37:41.719Z] 

[2020-10-05T23:37:41.719Z] 

[2020-10-05T23:37:42.292Z] 
Uploading conan_package.tgz                                           

[2020-10-05T23:37:42.292Z] 

[2020-10-05T23:37:42.555Z] 
Uploading conaninfo.txt                                               
Uploading conanmanifest.txt                                           

[2020-10-05T23:37:42.555Z]"

When I am using the old build server the consumption is working.

I have noticed that the package id is different when I am uploading an artifact from the old build server and the new.

From the information in the net I understood that the package id is a hash that I cannot control of.

So my question is why Conan expecting the old hash and how can I change it?


Solution

  • The binary that you are trying to install in the new server is requesting this binary:

    [2020-10-06T14:49:07.485Z] - Settings: arch=x86_64, build_type=Release, compiler=Visual Studio, compiler.runtime=MD, compiler.version=14, os=Windows
    

    So you are trying to install it with compiler.version=14

    You can check in the created package that the configuration used to build it is:

    [2020-10-05T23:37:36.335Z] Found Visual Studio 15
    [2020-10-05T23:37:36.335Z] Default settings
    [2020-10-05T23:37:36.335Z]  os=Windows
    [2020-10-05T23:37:36.335Z]  os_build=Windows
    [2020-10-05T23:37:36.335Z]  arch=x86_64
    [2020-10-05T23:37:36.335Z]  arch_build=x86_64
    [2020-10-05T23:37:36.335Z]  compiler=Visual Studio 
    [2020-10-05T23:37:36.335Z]  compiler.version=15
    [2020-10-05T23:37:36.335Z]  build_type=Release
    

    That is compiler.version=15

    The default profile is auto-detected and uses the latest Visual Studio compiler found in the system. For production usage it is recommended to use your own profiles, not autodetect ones.

    Make sure that you are using the same configuration to create the package and to consume it. You can create and upload as many configurations as you want, but when you install it, the default is that it should exist (it is possible to request building it from sources with --build, but the default behavior is to find a matching binary or fail)