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

deno upgrade.... Deno has panicked. #20683

Closed
crowlsyong opened this issue Sep 26, 2023 · 14 comments · Fixed by #20711
Closed

deno upgrade.... Deno has panicked. #20683

crowlsyong opened this issue Sep 26, 2023 · 14 comments · Fixed by #20711
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@crowlsyong
Copy link

I have gotten this error a few times in the last few days/weeks. In the most recent case, I wanted to test some Deno KV stuff with Fresh Framework.

deno run -A -r https://fresh.deno.dev
deno-kv-playground
Tailwind? Y
VS Code? Y

cd deno-kv-playground

deno upgrade

PS C:\X\X\playground\deno-kv-playground> deno upgrade
Looking up latest version
Found latest version 1.37.0
Downloading https://github.com/denoland/deno/releases/download/v1.37.0/deno-x86_64-pc-windows-msvc.zip
Deno is upgrading to version 1.37.0

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.36.1
Args: ["C:\\x\\x\\.deno\\bin\\deno.exe", "upgrade"]

thread 'main' panicked at 'assertion failed: unpack_status.success()', cli\tools\upgrade.rs:561:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

then I tried:

PS C:\X\X\playground\deno-kv-playground> $env:RUST_BACKTRACE=1
>> deno upgrade
>>
Looking up latest version
Found latest version 1.37.0
Downloading https://github.com/denoland/deno/releases/download/v1.37.0/deno-x86_64-pc-windows-msvc.zip
Deno is upgrading to version 1.37.0

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.36.1
Args: ["C:\\x\\x\\.deno\\bin\\deno.exe", "upgrade"]

thread 'main' panicked at 'assertion failed: unpack_status.success()', cli\tools\upgrade.rs:561:3
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Not sure how to proceed, so I followed the directions and reported it here because I couldn't find another issue with the exact same sequence that I used.

@crowlsyong
Copy link
Author

then I tried:
deno run -A -r https://fresh.deno.dev/update .

PS C:\X\X\playground\deno-kv-playground> deno run -A -r https://fresh.deno.dev/update .
A new release of Deno is available: 1.36.1 → 1.37.0 Run `deno upgrade` to install it.
The manifest has been generated for 5 routes and 1 islands.

so then i tried deno upgrade and still got the error

PS C:\X\X\playground\deno-kv-playground> deno upgrade
Looking up latest version
Found latest version 1.37.0
Downloading https://github.com/denoland/deno/releases/download/v1.37.0/deno-x86_64-pc-windows-msvc.zip
Deno is upgrading to version 1.37.0

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.36.1
Args: ["C:\\x\\x\\.deno\\bin\\deno.exe", "upgrade"]

thread 'main' panicked at 'assertion failed: unpack_status.success()', cli\tools\upgrade.rs:561:3
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@lucacasonato
Copy link
Member

lucacasonato commented Sep 26, 2023

Can you try upgrade to 1.36.3 by running deno upgrade --version 1.36.3?

@lucacasonato lucacasonato added bug Something isn't working correctly cli related to cli/ dir labels Sep 26, 2023
@dsherret
Copy link
Member

Also, what version of powershell do you have installed?

> powershell.exe
> $PSVersionTable
<version will be outputted here>

Maybe you have an old version installed? Seems like that command is failing for some reason.

assert!(unpack_status.success());

@crowlsyong
Copy link
Author

Can you try upgrade to 1.36.3 by running deno upgrade --version 1.36.3?

deno upgrade --version 1.36.3
Downloading https://github.com/denoland/deno/releases/download/v1.36.3/deno-x86_64-pc-windows-msvc.zip
Deno is upgrading to version 1.36.3

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.36.1
Args: ["C:\\X\\X\\.deno\\bin\\deno.exe", "upgrade", "--version", "1.36.3"]

thread 'main' panicked at 'assertion failed: unpack_status.success()', cli\tools\upgrade.rs:561:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
> powershell.exe
> $PSVersionTable
<version will be outputted here>
PS C:\X\X\competition-app-playground2> $PSVersionTable.PSVersion
>> 

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      3      7

@crowlsyong
Copy link
Author

You are absolute legends for taking the time to scope this out. Thank you. It's not solved yet but I'm just grateful for y'all.

I downloaded latest version of powershell just to be sure, opened it as administrator, ran deno upgrade, got the same Deno has panicked error

also found C:\Program Files\PowerShell\7\pwsh.exe and set vs code terminal to open there, then closed vs code and reopened it, then tried to deno upgrade but got the same error

@dsherret
Copy link
Member

dsherret commented Sep 26, 2023

@crowlsyong that looks like the pwsh.exe version (powershell core) and not powershell.exe. Can you re-run this while first executing "powershell.exe" first in order to get into windows powershell?

> powershell.exe
> $PSVersionTable
<version will be outputted here>

Then maybe try running (in powershell.exe---not powershell core):

> Add-Type -AssemblyName System.IO.Compression.FileSystem
> [System.IO.Compression.ZipFile]::ExtractToDirectory

Not sure it will reveal anything though. Maybe what's happening is the temp directory can't be written to. Anyway, I opened #20691 to surface whatever the output is of that command. (Edit: should already be surfaced....)

@crowlsyong
Copy link
Author

well well well, looky here. i'm not exactly sure what this means, but it seems like I'm not on version 7!

Name                           Value
----                           -----
PSVersion                      5.1.22621.1778
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.1778
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
PS C:\x\x\competition-app-playground2> powershell.exe
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\x\x\competition-app-playground2> Add-Type -AssemblyName System.IO.Compression.FileSystem
PS C:\x\x\competition-app-playground2> [System.IO.Compression.ZipFile]::ExtractToDirectory
Unable to find type [System.IO.Compression.ZipFile].
At line:1 char:1
+ [System.IO.Compression.ZipFile]::ExtractToDirectory
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.IO.Compression.ZipFile:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

PS C:\x\x\competition-app-playground2> Add-Type -AssemblyName System.IO.Compression.FileSystem
>> > [System.IO.Compression.ZipFile]::ExtractToDirectory
PS C:\x\x\competition-app-playground2> 

I am not sure if that helps, but I tried doing what you said and it doesn't seem like I made much progress. I tried deno upgrade just for kicks and giggles and it didn't work. I will take a deeper look into vs code settings, my powershell settings, and I'll return if I come up with anything yummy.

@dsherret
Copy link
Member

It's very confusing, but your Powershell Core is version 7 and the Windows Powershell version is 5 (same for me). Your windows powershell version is actually slightly newer than mine.

My guess is maybe there is no .net framework installed on your machine or it's very old. We should look into replacing the powershell.exe call in Deno with something not dependent on the machine setup.

@crowlsyong
Copy link
Author

I'm not sure if I should close this or not- I still can't upgrade Deno right now but it looks like you are implementing updates. I tried downloading the latest .NET from Microsoft, tried downloading latest version of powershell 7, I put this in vs code settings json: "terminal.external.windowsExec": "C:\\Program Files\\PowerShell\\7\\pwsh.exe" and still no luck.

Could it be something in my deno.json?

{
  "lock": false,
  "tasks": {
    "check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
    "start": "deno run -A --unstable --watch=static/,routes/ dev.ts",
    "build": "deno run -A dev.ts build",
    "preview": "deno run -A main.ts",
    "update": "deno run -A -r https://fresh.deno.dev/update ."
  },
  "lint": {
    "rules": {
      "tags": [
        "fresh",
        "recommended"
      ]
    },
    "exclude": [
      "_fresh"
    ]
  },
  "fmt": {
    "exclude": [
      "_fresh"
    ]
  },
  "imports": {
    "🛠️/": "./utils/",
    "🏝️/": "./islands/",
    "🧱/": "./components/",

    "$fresh/": "https://deno.land/x/fresh@1.4.3/",
    "preact": "https://esm.sh/preact@10.15.1",
    "preact/": "https://esm.sh/preact@10.15.1/",
    "preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
    "@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
    "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
    "twind": "https://esm.sh/twind@0.16.19",
    "twind/": "https://esm.sh/twind@0.16.19/",
    "$std/": "https://deno.land/std@0.193.0/"
  },
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "preact"
  }
}

Perhaps my VPN is causing some issue during the connection? Haha I'm truly clueless.

@dsherret
Copy link
Member

I think it has to do with your Windows Powershell (powershell.exe) environment (again, this has nothing to do with powershell core 7--pwsh.exe). As a quick fix, I'm thinking that if unextracting fails we should retry with pwsh.exe.

@dsherret
Copy link
Member

I opened #20711 which should fix this issue. We can use tar.exe instead.

@crowlsyong
Copy link
Author

thank you. I really appreciate the help and communication. I'm not sure how the extraction process works, but if there is any information I can provide, or instructions I can follow, let me know. 🙏

@crowlsyong
Copy link
Author

crowlsyong commented Sep 27, 2023

Can you re-run this while first executing "powershell.exe" first in order to get into windows powershell?

> powershell.exe
> $PSVersionTable
<version will be outputted here>

Then maybe try running (in powershell.exe---not powershell core):

> Add-Type -AssemblyName System.IO.Compression.FileSystem
> [System.IO.Compression.ZipFile]::ExtractToDirectory

I forgot to try the ladder half of what you suggested. So here is my attempt which did not result in deno upgrade being successful. Thank you for helping though.

> powershell.exe

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.1778
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.1778
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

> Add-Type -AssemblyName System.IO.Compression.FileSystem
> [System.IO.Compression.ZipFile]::ExtractToDirectory

OverloadDefinitions
-------------------
static void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName)
static void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName, bool overwriteFiles)
static void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName, System.Text.Encoding entryNameEncoding)
static void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName, System.Text.Encoding entryNameEncoding, bool overwriteFiles)

> deno upgrade

Looking up latest version
Found latest version 1.37.1
Downloading https://github.com/denoland/deno/releases/download/v1.37.1/deno-x86_64-pc-windows-msvc.zip
Deno is upgrading to version 1.37.1

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.36.1
Args: ["C:\\x\\x\\.deno\\bin\\deno.exe", "upgrade"]

thread 'main' panicked at 'assertion failed: unpack_status.success()', cli\tools\upgrade.rs:561:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@crowlsyong
Copy link
Author

Just some more debug info if ya want it
I made a .env file and put RUST_BACKTRACE=1 inside of it
Then, I did:
> $env:RUST_BACKTRACE=1
> deno upgrade

Looking up latest version
Found latest version 1.37.1
Downloading https://github.com/denoland/deno/releases/download/v1.37.1/deno-x86_64-pc-windows-msvc.zip
Deno is upgrading to version 1.37.1

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.36.1
Args: ["C:\\Users\\crowl\\.deno\\bin\\deno.exe", "upgrade"]

thread 'main' panicked at 'assertion failed: unpack_status.success()', cli\tools\upgrade.rs:561:3
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

> $env:RUST_BACKTRACE=full

full: The term 'full' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

dsherret added a commit that referenced this issue Sep 27, 2023
This is what we do for deno install, so it should be fine here
denoland/deno_install#219

Closes #20683
bartlomieju pushed a commit that referenced this issue Oct 12, 2023
This is what we do for deno install, so it should be fine here
denoland/deno_install#219

Closes #20683
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants