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

Clients v0.14 and v0.15 can't download files! #185

Closed
hakan42 opened this issue Oct 27, 2014 · 9 comments
Closed

Clients v0.14 and v0.15 can't download files! #185

hakan42 opened this issue Oct 27, 2014 · 9 comments
Assignees
Labels
Bug Core (ckan.dll) Issues affecting the core part of CKAN

Comments

@hakan42
Copy link
Member

hakan42 commented Oct 27, 2014

Hi,

I am using the Spin-stabilised release (cute names by the way :-) ). Our proxy seems to rewrite SSL certificates, and ckan seems to handle the metadata download differently from module downloads...

Q:\Kerbal Space Program>ckan version
Using KSP installation at "Q:\Kerbal Space Program"
v0.15-0-g344fae2

Updating the metadata works:

Q:\Kerbal Space Program>ckan update
Using KSP installation at "Q:\Kerbal Space Program"
Downloading updates...
Downloading https://github.com/KSP-CKAN/CKAN-meta/archive/master.zip
Updated information on 21 available modules

But installation of a module from kerbalstuff fails:

Q:\Kerbal Space Program>ckan install CrewFiles
Using KSP installation at "Q:\Kerbal Space Program"
About to install...

 * CrewFiles 2.0.0.1

Continue? [Y/N]

Downloading "https://kerbalstuff.com/mod/39/CrewFiles/download/2.0.0.1"
Failed to download "https://kerbalstuff.com/mod/39/CrewFiles/download/2.0.0.1" - error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

Unhandled Exception: System.InvalidOperationException: TransactionScope nested incorrectly.
   at System.Transactions.TransactionScope.Dispose()
   at CKAN.FilesystemTransaction.Rollback()
   at CKAN.ModuleInstaller.InstallList(List`1 modules, RelationshipResolverOptions options, Boolean downloadOnly)
   at CKAN.MainClass.Install(InstallOptions options)
   at CKAN.MainClass.Main(String[] args)
^C
@ROMB
Copy link
Contributor

ROMB commented Oct 27, 2014

This is interesting question. I think we should add configuration feature to ignore invalid certificates.

@ROMB ROMB added Core (ckan.dll) Issues affecting the core part of CKAN Enhancement labels Oct 27, 2014
@pjf
Copy link
Member

pjf commented Oct 27, 2014

Oooh! This is really fascinating! @hakan42 : Can you try installing any other mod from KerbalStuff and see if you get the same message? DogeCoinFlag is pretty tiny, and pretty good for testing. (It's just a single file.)

@pjf
Copy link
Member

pjf commented Oct 27, 2014

So, really interesting things here:

  1. This is reporting errors in TransactionScope, which means we're probably doing something incorrectly with transactions. (Relevant to Remove our own FilesystemTransaction? #181 ).
  2. I can't seem to download any new files except the index, but my client just hangs. I suspect it's the Linux version of the same bug.

I'm going to try testing with v0.14, and then we might be running a git bisect to find where we introduced the fault.

@pjf
Copy link
Member

pjf commented Oct 27, 2014

Okay, v0.14 has the bug, but v0.13 does not. A strace reveals it starts trying to read from stdin for some reason on my system.

@hakan42
Copy link
Member Author

hakan42 commented Oct 27, 2014

With DogeCoinFlag, I get the same error:

Q:\Kerbal Space Program>ckan install DogeCoinFlag
Using KSP installation at "Q:\Kerbal Space Program"
About to install...

 * DogeCoinFlag 1.02

Continue? [Y/N]

Downloading "https://kerbalstuff.com/mod/269/Dogecoin Flag/download/1.02"

Unhandled Exception: System.InvalidOperationException: A TransactionScope must be disposed on the same thread that it was created.
   at System.Transactions.TransactionScope.Dispose()
   at CKAN.FilesystemTransaction.Commit()
   at CKAN.NetAsyncDownloader.FileDownloadComplete(Int32 index, Exception error)
   at CKAN.NetAsyncDownloader.<StartDownload>c__AnonStorey1.<>m__5(Object sender, AsyncCompletedEventArgs args)
   at System.Net.WebClient.OnDownloadFileCompleted(AsyncCompletedEventArgs e)
   at System.Net.WebClient.DownloadFileOperationCompleted(Object arg)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

@pjf
Copy link
Member

pjf commented Oct 27, 2014

git bisect good v0.13
git bisect bad v0.14

4c58ebe... good
fcc75a8... bad
4520272... bad (but with a *really* informative error mssage)
17df16d... good

4520272e8b901cb44faff5f9c89c46d0af31f45f is the first bad commit

Hmm, that's from our work on #161, #166 , #171 and friends, which is all about how we handle transactions.

Investigating! (Also, git bisect rocks!)

@ROMB ROMB added Bug and removed Enhancement labels Oct 27, 2014
@pjf pjf changed the title Certificate validation problem behind $WORK proxy Clients v0.14 and v0.15 can't download files! Oct 27, 2014
@pjf pjf added ★★★ and removed Enhancement labels Oct 27, 2014
@pjf
Copy link
Member

pjf commented Oct 27, 2014

Also relevant here is that we can download the index, and ks2ckan can download files just fine, so there must be something different with how the ckan client is downloading mod files themselves.

@pjf
Copy link
Member

pjf commented Oct 27, 2014

I seem to have a fix for this, but I'm writing tests and making it pretty. :)

@pjf pjf added In progress We're still working on this Pull request and removed ★★★ In progress We're still working on this labels Oct 27, 2014
@pjf
Copy link
Member

pjf commented Oct 27, 2014

While this is still waiting on code-review befor hitting out master branch, there's now a bugfix release (v0.15.1) which uses my dev code that I believe fixes this. Enjoy! :)

@pjf pjf self-assigned this Oct 27, 2014
@pjf pjf closed this as completed in 8b6f67a Oct 28, 2014
@pjf pjf removed the Pull request label Oct 28, 2014
RichardLake pushed a commit to RichardLake/CKAN that referenced this issue May 30, 2015
Closes KSP-CKAN#185 (no download bug)
Closes KSP-CKAN#181 (replace our transactions)

We have a lot fewer transactions than I expected, but this seems
to fix the no-download bug in KSP-CKAN#185.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Core (ckan.dll) Issues affecting the core part of CKAN
Projects
None yet
Development

No branches or pull requests

3 participants