-
Notifications
You must be signed in to change notification settings - Fork 44
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
WinRPM.update() failing to download XML on Windows #80
Comments
https://msdn.microsoft.com/en-us/library/ms695782(v=vs.85).aspx
|
Thanks @tkelman . Will look into it 👍 |
might be an https certificate issue or something, can you read the url from a browser? |
Hmm. Yeah. If I paste the URL in the browser, I can see the XML response. |
I also tried running the REPL as admin, but no luck |
I'm new to this, but I suppose I should mention this is running on an Azure VM... |
If you do |
julia> download_cmd("https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.2/repodata/repomd.xml", "repomd.xml")
PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>]
[-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive]
[-InputFormat {Text | XML}] [-OutputFormat {Text | XML}]
[-WindowStyle <style>] [-EncodedCommand <Base64EncodedCommand>]
[-File <filePath> <args>] [-ExecutionPolicy <ExecutionPolicy>]
[-Command { - | <script-block> [-args <arg-array>]
| <string> [<CommandParameters>] } ]
PowerShell[.exe] -Help | -? | /?
-PSConsoleFile
Loads the specified Windows PowerShell console file. To create a console
file, use Export-Console in Windows PowerShell.
-Version
Starts the specified version of Windows PowerShell.
Enter a version number with the parameter, such as "-version 2.0".
-NoLogo
Hides the copyright banner at startup.
-NoExit
Does not exit after running startup commands.
-Sta
Starts the shell using a single-threaded apartment.
Single-threaded apartment (STA) is the default.
-Mta
Start the shell using a multithreaded apartment.
-NoProfile
Does not load the Windows PowerShell profile.
-NonInteractive
Does not present an interactive prompt to the user.
-InputFormat
Describes the format of data sent to Windows PowerShell. Valid values are
"Text" (text strings) or "XML" (serialized CLIXML format).
-OutputFormat
Determines how output from Windows PowerShell is formatted. Valid values
are "Text" (text strings) or "XML" (serialized CLIXML format).
-WindowStyle
Sets the window style to Normal, Minimized, Maximized or Hidden.
-EncodedCommand
Accepts a base-64-encoded string version of a command. Use this parameter
to submit commands to Windows PowerShell that require complex quotation
marks or curly braces.
-File
Runs the specified script in the local scope ("dot-sourced"), so that the
functions and variables that the script creates are available in the
current session. Enter the script file path and any parameters.
File must be the last parameter in the command, because all characters
typed after the File parameter name are interpreted
as the script file path followed by the script parameters.
-ExecutionPolicy
Sets the default execution policy for the current session and saves it
in the $env:PSExecutionPolicyPreference environment variable.
This parameter does not change the Windows PowerShell execution policy
that is set in the registry.
-Command
Executes the specified commands (and any parameters) as though they were
typed at the Windows PowerShell command prompt, and then exits, unless
NoExit is specified. The value of Command can be "-", a string. or a
script block.
If the value of Command is "-", the command text is read from standard
input.
If the value of Command is a script block, the script block must be enclosed
in braces ({}). You can specify a script block only when running PowerShell.exe
in Windows PowerShell. The results of the script block are returned to the
parent shell as deserialized XML objects, not live objects.
If the value of Command is a string, Command must be the last parameter
in the command , because any characters typed after the command are
interpreted as the command arguments.
To write a string that runs a Windows PowerShell command, use the format:
"& {<command>}"
where the quotation marks indicate a string and the invoke operator (&)
causes the command to be executed.
-Help, -?, /?
Shows this message. If you are typing a PowerShell.exe command in Windows
PowerShell, prepend the command parameters with a hyphen (-), not a forward
slash (/). You can use either a hyphen or forward slash in Cmd.exe.
EXAMPLES
PowerShell -PSConsoleFile SqlSnapIn.Psc1
PowerShell -version 2.0 -NoLogo -InputFormat text -OutputFormat XML
PowerShell -Command {Get-EventLog -LogName security}
PowerShell -Command "& {Get-EventLog -LogName security}"
# To use the -EncodedCommand parameter:
$command = 'dir "c:\program files" '
$bytes = [System.Text.Encoding]::Unicode.GetBytes($command)
$encodedCommand = [Convert]::ToBase64String($bytes)
powershell.exe -encodedCommand $encodedCommand
`powershell -Command '(new-object net.webclient).DownloadFile("https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.2/repodata/repomd.xml", "repomd.xml")'`
julia> download_cmd
download_cmd (generic function with 1 method)
|
sorry, run the command -
then you should end up with a |
Yeah. That worked. It downloaded the XML. If I do that in .julia/WinRPM, where should I put it so it finds it? I'll also try to figure it out myself... |
the code here is pretty short, if you can find where the downloading happens you should be able to add in some |
Hmm... I ended up just copying over WinRPM from my local machine to the remote VM which got If I modify WinRPM.update() so it uses download_cmd, should I submit a PR here? |
I suppose we could try that. Not sure how it would fit into the current code which passes around status codes and a few other things. |
Ok. I am in a bit of a bind (and time is not on my side), so I'll have a go at modifying the download function @unix_only download(source::AbstractString) = (x=HTTPC.get(source); (bytestring(x.body),x.http_code))
@windows_only function download(source::AbstractString; retry = 5)
dest = Array(UInt16,261)
for i in 1:retry
res = ccall((:URLDownloadToCacheFileW,:urlmon),stdcall,Cuint,
(Ptr{Void},Ptr{UInt16},Ptr{UInt16},Clong,Cint,Ptr{Void}),
C_NULL,utf16(source),dest,sizeof(dest)>>1,0,C_NULL)
if res == 0
resize!(dest, findfirst(dest, 0))
filename = utf8(UTF16String(dest))
if isfile(filename)
return readall(filename),200
end
else
warn("Unknown download failure, error code: $res")
end
warn("Retry $i/$retry downloading: $source")
end
return "",0
end |
Instead of BinDeps, I could do it pretty easily with Requests, but then Requests becomes a dependency of WinRPM. Are you ok with that? |
No, Requests should in an ideal world be getting its binaries from here. You don't need Requests to download a file, Requests has its own binary dependencies. |
Ok. So I'll try to modify the download function above to use |
Hmm... it appears the |
to be fair, the function you quoted above is kind of faking the status anyway. |
I noticed. I'll try a similar fake :) |
Hi @tkelman Here is what I have and it seems to be working 👍 @windows_only function download(source::AbstractString)
filename = joinpath(dirname(@__FILE__),"..","cache",basename(source))
run(BinDeps.download_cmd(source,filename))
if isfile(filename)
return readall(filename),200
end
return "",0
end Downsides: 1 It leaves the .gz files in the cache folder (in Windows) Are the downsides, ok? Any idea how to silence the PowerShell stuff? |
I think master of BinDeps might be quieter w.r.t. powershell, it may have been a while since the last tag? What version of BinDeps are you using? |
I was using the latest tagged version (a fresh install of Julia on the remote VM). I'll try master, but when I did your experience before to test download_cmd, I thought it worked without the noise (but maybe I was on master at that time - I've been checking out and freeing in a trial and error fashion). |
@tkelman , if I were to submit a PR for WinRPM, should I start from the latest tagged version or from master? |
PR's should be based off master |
Cross-ref: JuliaInterop/ZMQ.jl#90 (comment) |
I'm having a similar problem with repomod.xml. I can download manually or visit it in a browser, but it won't download from WinRPM in Julia 0.5. The error is 2148270088 (-2146697208). I couldn't find it on Microsoft's site. I tried to checkout master. Same problem. It's preventing gtk and cairo from building. I'm not sure what changed as everything had been working fine; it may have something to do with upgrading anaconda, which changed from Python 3.5 to 3.6? |
I wiped out WinRPM and rebooted. Then I ran something like Pkg.update() which re-installed but still failed on repmod.xml. But when I ran WinRPM.update() this time, it seems to have fixed the problem and rebuilt Gtk. Unfortunately, ProfileView is still broken, so something is still wrong. |
I also get error code 2148270088 |
same error code here:
update:I finally fixed this using a router to globally bypass the infamous GFW(I'm living in China). 🤔 |
Also trying to help a user with 2148270088. |
I know this issue has been mentioned numerous times now on WinRPM.jl (see #127 #47 #88 #115 ) - and i am new to Julia and github so i may just be so naive that i'm missing the solution referenced somewhere - but i have been trying to get WinRPM installed for 2 days now with no luck. I am using Win10 64bit, julia v0.6.2, and i have tried changing the sources.list in /.julia/v0.6/WinRPM to every variation i have found mentioned in these discussions to no avail. I manage to download the repodata/repomd.xml manually using:
But i don't know where the repomd.xml file then belongs to stop the error '2148270088' appearing when i attempt to Pkg.build("WinRPM"). The full error: julia> Pkg.build("WinRPM")
INFO: Building WinRPM
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 1/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 2/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 3/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 4/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 5/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: received error 0 while downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 1/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 2/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 3/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 4/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270088
WARNING: Retry 5/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: received error 0 while downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml |
https://ftp5.gwdg.de/pub/opensuse/repositories/windows:/mingw:/win32/openSUSE_Leap_42.3/ |
I have similar downloading issues on Windows 10 (on an Azure VM) using FYI I modified |
Any ideas?
The text was updated successfully, but these errors were encountered: