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

invalid version 0 on git_proxy_options #1769

Closed
AffectedArc07 opened this issue Feb 21, 2020 · 3 comments
Closed

invalid version 0 on git_proxy_options #1769

AffectedArc07 opened this issue Feb 21, 2020 · 3 comments

Comments

@AffectedArc07
Copy link

Reproduction steps

Try to run a netcore 2.1 app on Ubuntu

Expected behavior

It to clone a repository like normal

Actual behavior

This happens

fail: Hangfire.AutomaticRetryAttribute[0]
      Failed to process the job '52': an exception occurred.
System.AggregateException: One or more errors occurred. (invalid version 0 on git_proxy_options) (invalid version 0 on git_proxy_options) ---> LibGit2Sharp.LibGit2SharpException: invalid version 0 on git_proxy_options

Version of LibGit2Sharp (release number or SHA1)

0.26.2 running under netcore 2.1

Operating system(s) tested: Ubuntu Server 19.10

Other notes

I am not running a proxy server, and there has been no direct proxy configuration on my system, or in my Clone task

		public async Task Clone(string url, string path, Func<int, Task> onCloneProgress, CancellationToken cancellationToken)
		{
			if (url == null)
				throw new ArgumentNullException(nameof(url));
			if (path == null)
				throw new ArgumentNullException(nameof(path));
			List<Task> cloneTasks = null;
			if (onCloneProgress != null)
				cloneTasks = new List<Task>() { onCloneProgress(0) };
			await Task.Factory.StartNew(() =>
			{
				try
				{
					Repository.Clone(url, path, new CloneOptions()
					{
						Checkout = true,
						OnProgress = (m) => !cancellationToken.IsCancellationRequested,
						OnTransferProgress = (transferProgress) =>
						{
							if (cancellationToken.IsCancellationRequested)
								return false;
							if (cloneTasks != null)
							{
								var newTask = onCloneProgress((int)Math.Floor((100.0 * (transferProgress.ReceivedObjects + transferProgress.IndexedObjects)) / (transferProgress.TotalObjects * 2)));
								if (newTask != null)
									cloneTasks.Add(newTask);
							}
							return true;
						},
						OnUpdateTips = (a, b, c) => !cancellationToken.IsCancellationRequested,
					});
				}
				catch (UserCancelledException)
				{
					cancellationToken.ThrowIfCancellationRequested();
				}
			}, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Current).ConfigureAwait(false);
			if (cloneTasks != null)
				await Task.WhenAll(cloneTasks).ConfigureAwait(false);
		}
@Nelson-numerical-software
Copy link

Nelson-numerical-software commented May 1, 2020

after upgraded libgit2 v0.27.9 (OK) to v1.0.0 (KO)
I have same errors.

 01/12 - [webtools] test_repo                                               Fail
    run('D:/Developpements/Github/nelson/modules/webtools/tests/test_repo.nls')
    Error:
      repository error -1/3: invalid version 0 on git_proxy_options
 
 02/12 - [webtools] test_repo_export                                        Fail
    run('D:/Developpements/Github/nelson/modules/webtools/tests/test_repo_export.nls')
    Error:
      repository error -1/3: invalid version 0 on git_proxy_options

cmake results:

D:\libgit2-1.0.0\build>cmake ..
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.25.28614.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC - Failed
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC - Failed
-- Looking for futimens
-- Looking for futimens - not found
-- Checking prototype qsort_r for HAVE_QSORT_R_BSD - False
-- Checking prototype qsort_r for HAVE_QSORT_R_GNU - False
-- Looking for qsort_s
-- Looking for qsort_s - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
-- Could NOT find PCRE (missing: PCRE_LIBRARY PCRE_POSIX_LIBRARY PCRE_INCLUDE_DIR)
-- Looking for regcomp_l
-- Looking for regcomp_l - not found
-- Looking for dirent.h
-- Looking for dirent.h - not found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for windows.h
-- Looking for windows.h - found
-- Looking for bcopy
-- Looking for bcopy - not found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoq
-- Looking for strtoq - not found
-- Looking for _strtoi64
-- Looking for _strtoi64 - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED - Failed
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED - Failed
-- http-parser version 2 was not found or disabled; using bundled 3rd-party sources.
-- Performing Test IS_WIMPLICIT_FALLTHROUGH_1_SUPPORTED
-- Performing Test IS_WIMPLICIT_FALLTHROUGH_1_SUPPORTED - Failed
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- zlib was not found; using bundled 3rd-party sources.
-- LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIR)
-- Found PythonInterp: C:/WindowsTools/Python37/python.exe (found version "3.7.4")
-- Enabled features:
 * nanoseconds, whether to use sub-second file mtimes and ctimes
 * tracing, tracing support
 * threadsafe, threadsafe support
 * HTTPS, using WinHTTP
 * SHA, using CollisionDetection
 * regex, using bundled PCRE
 * http-parser, http-parser support (bundled)
 * zlib, using bundled zlib

-- Disabled features:
 * debugpool, debug pool allocator
 * SSH, SSH transport support
 * ntlmclient, NTLM authentication support for Unix
 * SPNEGO, SPNEGO authentication support
 * iconv, iconv encoding conversion support

-- Configuring done
-- Generating done
-- Build files have been written to: D:/libgit2-1.0.0/build

What did I miss ?

@TechnoMag82
Copy link

Same problem in version libgit2-1.0.1, with project for Linux.

bool GitWizard::cloneRepo(const QString &url, const QString &dir)
{
    git_repository *tempRepo = nullptr;
    git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
    git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT;

    checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE;

    clone_opts.checkout_opts = checkout_opts;

    clone_opts.fetch_opts.callbacks.credentials = cred_acquire_cb;

    int error = git_clone(&tempRepo, url.toUtf8().constData(),
                          dir.toUtf8().constData(), &clone_opts);
    if (!checkForError(error, QString("Clone repository %1 to %2").arg(url, dir))) {
        git_repository_free(tempRepo);
        return true;
    }
    return false;
}

@bording
Copy link
Member

bording commented Dec 3, 2023

This should be fixed in the latest releases.

@bording bording closed this as completed Dec 3, 2023
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

No branches or pull requests

4 participants