supabase / cli

Supabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
https://supabase.com/docs/reference/cli/about
MIT License
1.07k stars 209 forks source link

Cannot use `supabase functions download` #1912

Closed KyleFontenot closed 7 months ago

KyleFontenot commented 9 months ago

Can't use supabase functions download <functionname>. Simply get Eszip extracted successfully inside path /home/deno Not sure why it'd download there, but it is not downloaded at all. Nothing is actually downloaded to the /home/deno folder, nor to the supabase/functions/ folder as I would expect. /home/deno doesnt exist and if i were to make it, I get the same error still. If I install deno, the error persists the exact same.

To Reproduce Steps to reproduce the behavior:

  1. install supabase cli and docker desktop.
  2. use supabase login to authenticate
  3. Can but dont have to use supabase link
  4. Run supabase functions download <functionname>

Expected behavior Downloaded source code to a folder somewhere like the documentation says it would.

System information I ran supabase functions download functionname --create-ticket and it spit out the same error: Eszip extracted successfully inside path /home/deno. ?

Debug flag Using debug flag:

Supabase CLI 1.136.3
Downloading <function_name>
2024/02/04 14:02:30 DNS Start: {Host:api.supabase.com}
2024/02/04 14:02:30 DNS Done: {Addrs:[{IP:172.67.172.49 Zone:} {IP:<IP> Zone:} {IP:<ipv6> Zone:} {IP:<IPv6>Zone:}] Err:<nil> Coalesced:false}
2024/02/04 14:02:30 Connect Start: tcp 172.67.172.49:443
2024/02/04 14:02:30 Connect Done: tcp 172.67.172.49:443
2024/02/04 14:02:30 TLS Start
2024/02/04 14:02:30 TLS Done: {Version:772 HandshakeComplete:true DidResume:false CipherSuite:4865 NegotiatedProtocol:h2 NegotiatedProtocolIsMutual:true ServerName:api.supabase.com PeerCertificates:[0xc00040b600 0xc00040bb80 0xc00040c100 0xc00040c680] VerifiedChains:[[0xc00040cc00 0xc00040d180 0xc00040d700]] SignedCertificateTimestamps:[] OCSPResponse:[48 130 1 85 10 1 0 160 130 1 78 48 130 1 74 6 9 43 6 1 5 5 7 48 1 1 4 130 1 59 48 130 1 55 48 129 190 161 52 48 50 49 11 48 9 6 3 85 4 6 19 2 85 83 49 22 48 20 6 3 85 4 10 19 13 76 101 116 39 115 32 69 110 99 114 121 112 116 49 11 48 9 6 3 85 4 3 19 2 69 49 24 15 50 48 50 52 48 50 48 49 48 51 51 50 48 48 90 48 117 48 115 48 75 48 9 6 5 43 14 3 2 26 5 0 4 20 239 144 1 112 221 88 143 42 101 30 33 81 31 220 208 187 111 81 43 171 4 20 90 243 237 43 252 54 194 55 121 185 82 48 234 84 111 207 85 203 46 172 2 18 4 52 217 5 193 95 6 36 206 83 231 214 129 48 136 97 98 51 128 0 24 15 50 48 50 52 48 50 48 49 48 51 51 50 48 48 90 160 17 24 15 50 48 50 52 48 50 48 56 48 51 51 49 53 56 90 48 10 6 8 42 134 72 206 61 4 3 3 3 104 0 48 101 2 48 3 182 245 56 57 83 245 91 170 152 206 0 18 246 13 203 209 97 83 81 81 185 83 158 65 91 182 184 94 111 221 236 196 179 191 171 66 222 147 78 96 156 203 216 55 204 195 59 2 49 0 242 61 27 71 142 176 254 175 94 215 179 207 126 200 0 41 239 104 225 222 120 225 133 115 56 8 25 209 89 57 131 116 26 140 153 80 102 207 182 114 223 106 133 139 234 146 82 246] TLSUnique:[] ekm:0x1257ba0}
2024/02/04 14:02:30 Sent Header: :authority [api.supabase.com]
2024/02/04 14:02:30 Sent Header: :method [GET]
2024/02/04 14:02:30 Sent Header: :path [/v1/projects/<project_ref>/functions/<function_name>/body]
2024/02/04 14:02:30 Sent Header: :scheme [https]
2024/02/04 14:02:30 Sent Header: authorization [Bearer <redacted>]
2024/02/04 14:02:30 Sent Header: user-agent [SupabaseCLI/1.136.3]
2024/02/04 14:02:30 Sent Header: accept-encoding [gzip]
2024/02/04 14:02:30 Send Done
2024/02/04 14:02:30 Recv First Byte
2024/02/04 14:02:30 Sent Header: Host [api.moby.localhost]
2024/02/04 14:02:30 Sent Header: User-Agent [Docker-Client/unknown-version (darwin)]
2024/02/04 14:02:30 Send Done
2024/02/04 14:02:35 Recv First Byte
2024/02/04 14:02:35 Sent Header: Host [api.moby.localhost]
2024/02/04 14:02:35 Sent Header: User-Agent [Docker-Client/unknown-version (darwin)]
2024/02/04 14:02:35 Sent Header: Content-Length [322]
2024/02/04 14:02:35 Sent Header: Content-Type [application/json]
2024/02/04 14:02:35 Send Done
2024/02/04 14:02:35 Recv First Byte
2024/02/04 14:02:35 Sent Header: Host [api.moby.localhost]
2024/02/04 14:02:35 Sent Header: User-Agent [Docker-Client/unknown-version (darwin)]
2024/02/04 14:02:35 Sent Header: Content-Length [147]
2024/02/04 14:02:35 Sent Header: Content-Type [application/json]
2024/02/04 14:02:35 Send Done
2024/02/04 14:02:35 Recv First Byte
2024/02/04 14:02:35 Sent Header: Host [api.moby.localhost]
2024/02/04 14:02:35 Sent Header: User-Agent [Docker-Client/unknown-version (darwin)]
2024/02/04 14:02:35 Sent Header: Content-Length [1998]
2024/02/04 14:02:35 Sent Header: Content-Type [application/json]
2024/02/04 14:02:35 Send Done
2024/02/04 14:02:35 Recv First Byte
2024/02/04 14:02:35 Sent Header: Host [api.moby.localhost]
2024/02/04 14:02:35 Sent Header: User-Agent [Docker-Client/unknown-version (darwin)]
2024/02/04 14:02:35 Sent Header: Content-Length [0]
2024/02/04 14:02:35 Sent Header: Content-Type [text/plain]
2024/02/04 14:02:35 Send Done
2024/02/04 14:02:35 Recv First Byte
2024/02/04 14:02:35 Sent Header: Host [api.moby.localhost]
2024/02/04 14:02:35 Sent Header: User-Agent [Docker-Client/unknown-version (darwin)]
2024/02/04 14:02:35 Send Done
2024/02/04 14:02:35 Recv First Byte
Eszip extracted successfully inside path /home/deno
2024/02/04 14:02:35 Sent Header: Host [api.moby.localhost]
2024/02/04 14:02:35 Sent Header: User-Agent [Docker-Client/unknown-version (darwin)]
2024/02/04 14:02:35 Send Done
2024/02/04 14:02:35 Recv First Byte

that is the full debug output. Seems like it ends abruptly.

sweatybridge commented 9 months ago

Could you try supabase functions download <name> --legacy-bundle?

We updated the download logic in v1.123.3 so functions deployed using earlier versions of cli would have to specify --legacy-bundle flag when downloading from newer cli.

KyleFontenot commented 9 months ago

If my edge function simply named edgefunction, the output of supabase functions download edgefunction --legacy-bundle --debug is:

Supabase CLI 1.136.3
Version 1.30.3 is already installed
Downloading edgefunction
2024/02/06 08:39:08 DNS Start: {Host:api.supabase.com}
2024/02/06 08:39:08 DNS Done: {Addrs:[{IP:104.21.30.61 Zone:} {IP:172.67.172.49 
Zone:}] Err:<nil> Coalesced:false}      
2024/02/06 08:39:08 Connect Start: tcp 104.21.30.61:443
2024/02/06 08:39:08 Connect Done: tcp 104.21.30.61:443
2024/02/06 08:39:08 TLS Start
2024/02/06 08:39:08 TLS Done: {Version:772 HandshakeComplete:true DidResume:false CipherSuite:4867 NegotiatedProtocol:h2 NegotiatedProtocolIsMutual:true ServerName:api.supabase.com PeerCertificates:[0xc000292000 0xc000292b00 0xc000293080 0xc000293600] VerifiedChains:[[0xc000293b80 0xc000294100 0xc000294680 0xc000294c00]] SignedCertificateTimestamps:[] OCSPResponse:[48 130 1 85 10 1 0 160 130 1 78 
48 130 1 74 6 9 43 6 1 5 5 7 48 1 1 4 130 1 59 48 130 1 55 48 129 190 161 52 48 
50 49 11 48 9 6 3 85 4 6 19 2 85 83 49 22 48 20 6 3 85 4 10 19 13 76 101 116 39 
115 32 69 110 99 114 121 112 116 49 11 48 9 6 3 85 4 3 19 2 69 49 24 15 50 48 50 52 48 50 48 52 50 48 48 57 48 48 90 48 
117 48 115 48 75 48 9 6 5 43 14 3 2 26 5 0 4 20 239 144 1 112 221 88 143 42 101 
30 33 81 31 220 208 187 111 81 43 171 4 
20 90 243 237 43 252 54 194 55 121 185 82 48 234 84 111 207 85 203 46 172 2 18 4 52 217 5 193 95 6 36 206 83 231 214 129 48 136 97 98 51 128 0 24 15 50 48 50 52 48 50 48 52 50 48 48 57 48 48 90 160 17 24 15 50 48 50 52 48 50 49 49 50 48 48 
56 53 56 90 48 10 6 8 42 134 72 206 61 4 3 3 3 104 0 48 101 2 49 0 173 136 94 25 173 184 185 232 28 146 99 11 115 37 176 134 89 223 74 185 79 135 187 182 100 186 117 74 234 217 168 79 156 204 150 214 
31 116 244 32 228 235 2 125 54 181 160 209 2 48 46 110 146 244 60 62 132 120 59 
24 44 67 73 64 250 181 0 50 4 127 104 27 117 133 193 207 7 81 20 158 251 9 160 214 90 253 177 133 147 3 7 177 101 59 233 132 0 137] TLSUnique:[] ekm:0xad5180}  
2024/02/06 08:39:08 Sent Header: :authority [api.supabase.com]
2024/02/06 08:39:08 Sent Header: :method [GET]
2024/02/06 08:39:08 Sent Header: :path [/v1/projects/<project_ref_redacted>/functions/edgefunction]
2024/02/06 08:39:08 Sent Header: :scheme [https]
2024/02/06 08:39:08 Sent Header: authorization [Bearer <redacted>]
2024/02/06 08:39:08 Sent Header: user-agent [SupabaseCLI/1.136.3]
2024/02/06 08:39:08 Sent Header: accept-encoding [gzip]
2024/02/06 08:39:08 Send Done
2024/02/06 08:39:10 Recv First Byte
2024/02/06 08:39:10 Sent Header: :authority [api.supabase.com]
2024/02/06 08:39:10 Sent Header: :method [GET]
2024/02/06 08:39:10 Sent Header: :path [/v1/projects/<project_ref_redacted/functions/edgefunction/body]
2024/02/06 08:39:10 Sent Header: :scheme [https]
2024/02/06 08:39:10 Sent Header: authorization [Bearer <redacted>]
2024/02/06 08:39:10 Sent Header: user-agent [SupabaseCLI/1.136.3]
2024/02/06 08:39:10 Sent Header: accept-encoding [gzip]
2024/02/06 08:39:10 Send Done
2024/02/06 08:39:12 Recv First Byte
Error downloading function: exit status 
1
panicked at 'called `Result::unwrap()` on an `Err` value: InvalidV2ModuleKind(3, 1074)', lib/lib.rs:179:65

Stack:
Error
    at __wbg_new_abda76e883ba8a5f (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:412:19)      
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1273410)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1632569)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1816308)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1701860)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:457152)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1388039)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1862894)
    at __wbg_adapter_18 (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:146:6)
    at real (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:130:14)  

error: Uncaught (in promise) RuntimeError: unreachable
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1632604)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1816308)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1701860)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:457152)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1388039)
    at <anonymous> (https://deno.land/x/eszip@v0.30.0/eszip_wasm_bg.wasm:1:1862894)
    at __wbg_adapter_18 (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:146:6)
    at real (https://deno.land/x/eszip@v0.30.0/eszip_wasm.generated.js:130:14) 

I get pretty much the same thing on WSL and Mac. I only made my edge function this last Friday, so it was deployed with the newer cli versions.

Says my cli version is 1.136 though, hmm. Installed with scoop on windows, I'll try to update my version.

KyleFontenot commented 9 months ago

Updated my CLI version to 1.142.1, and ran the download command and it looked good for a second:

Downloading edgefunction
v1.33.5: Pulling from supabase/edge-runtime
c57ee5000d61: Pull complete
0ecfabf388d7: Pull complete
a400b9a91751: Pull complete
6397e80bad98: Pull complete
Digest: sha256:278af37836314fcb716545c4bbcd9adcfc7b8cd3c457b3233f3502af6ad98632     
Status: Downloaded newer image for public.ecr.aws/supabase/edge-runtime:v1.33.5     
Eszip extracted successfully inside path /home/deno

But nothing was downloaded.

Then ran it with --debug :

Supabase CLI 1.142.1
Downloading edgefunction
2024/02/06 08:59:14 DNS Start: {Host:api.supabase.com}
2024/02/06 08:59:15 DNS Done: {Addrs:[{IP:172.67.172.49 Zone:} {IP:104.21.30.61 Zone:}] Err:<nil> Coalesced:false}
2024/02/06 08:59:15 Connect Start: tcp 172.67.172.49:443
2024/02/06 08:59:15 Connect Done: tcp 172.67.172.49:443
2024/02/06 08:59:15 TLS Start
2024/02/06 08:59:15 TLS Done: {Version:772 HandshakeComplete:true DidResume:false CipherSuite:4867 NegotiatedProtocol:h2 NegotiatedProtocolIsMutual:true ServerName:api.supabase.com PeerCertificates:[0xc0003a2b00 0xc0003a3080 0xc0003a3600 0xc0003a3b80] 
VerifiedChains:[[0xc0003a4100 0xc0003a4680 0xc0003a4c00 0xc0003a5180]] SignedCertificateTimestamps:[] OCSPResponse:[48 130 1 85 10 1 0 160 130 1 78 48 130 1 74 6 9 43 6 1 5 5 7 48 1 1 4 130 1 59 48 130 1 55 48 
129 190 161 52 48 50 49 11 48 9 6 3 85 4 6 19 2 85 83 49 22 48 20 6 3 85 4 10 19 13 
76 101 116 39 115 32 69 110 99 114 121 112 116 49 11 48 9 6 3 85 4 3 19 2 69 49 24 15 50 48 50 52 48 50 48 52 50 48 48 57 48 48 90 48 117 48 115 48 75 48 9 6 5 43 14 3 
2 26 5 0 4 20 239 144 1 112 221 88 143 42 
101 30 33 81 31 220 208 187 111 81 43 171 
4 20 90 243 237 43 252 54 194 55 121 185 82 48 234 84 111 207 85 203 46 172 2 18 4 52 217 5 193 95 6 36 206 83 231 214 129 48 
136 97 98 51 128 0 24 15 50 48 50 52 48 50 48 52 50 48 48 57 48 48 90 160 17 24 15 50 48 50 52 48 50 49 49 50 48 48 56 53 56 90 48 10 6 8 42 134 72 206 61 4 3 3 3 104 0 48 101 2 49 0 173 136 94 25 173 184 185 232 28 146 99 11 115 37 176 134 89 223 74 185 79 135 187 182 100 186 117 74 234 217 168 79 156 204 150 214 31 116 244 32 228 235 2 125 54 181 160 209 2 48 46 110 146 244 60 62 132 120 59 24 44 67 73 64 250 181 0 50 4 127 104 27 117 133 193 207 7 81 20 158 251 9 160 214 90 253 177 133 147 3 7 177 101 59 233 132 0 137] TLSUnique:[] ekm:0x385220}
2024/02/06 08:59:15 Sent Header: :authority [api.supabase.com]
2024/02/06 08:59:15 Sent Header: :method [GET]
2024/02/06 08:59:15 Sent Header: :path [/v1/projects/<project_ref>/functions/edgefunction/body]
2024/02/06 08:59:15 Sent Header: :scheme [https]
2024/02/06 08:59:15 Sent Header: authorization [Bearer <redacted>]
2024/02/06 08:59:15 Sent Header: user-agent [SupabaseCLI/1.142.1]
2024/02/06 08:59:15 Sent Header: accept-encoding [gzip]
2024/02/06 08:59:15 Send Done
2024/02/06 08:59:17 Recv First Byte
2024/02/06 08:59:17 Sent Header: Host [api.moby.localhost]
2024/02/06 08:59:17 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/02/06 08:59:17 Send Done
2024/02/06 08:59:17 Recv First Byte       
2024/02/06 08:59:17 Sent Header: Host [api.moby.localhost]
2024/02/06 08:59:17 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/02/06 08:59:17 Sent Header: Content-Length [307]
2024/02/06 08:59:17 Sent Header: Content-Type [application/json]
2024/02/06 08:59:17 Send Done
2024/02/06 08:59:17 Recv First Byte       
2024/02/06 08:59:17 Sent Header: Host [api.moby.localhost]
2024/02/06 08:59:17 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/02/06 08:59:17 Sent Header: Content-Length [132]
2024/02/06 08:59:17 Sent Header: Content-Type [application/json]
2024/02/06 08:59:17 Send Done
2024/02/06 08:59:17 Recv First Byte       
2024/02/06 08:59:17 Sent Header: Host [api.moby.localhost]
2024/02/06 08:59:17 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/02/06 08:59:17 Sent Header: Content-Length [1994]
2024/02/06 08:59:17 Sent Header: Content-Type [application/json]
2024/02/06 08:59:17 Send Done
2024/02/06 08:59:17 Recv First Byte
2024/02/06 08:59:17 Sent Header: Host [api.moby.localhost]
2024/02/06 08:59:17 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/02/06 08:59:17 Sent Header: Content-Length [0]
2024/02/06 08:59:17 Sent Header: Content-Type [text/plain]
2024/02/06 08:59:17 Send Done
2024/02/06 08:59:18 Recv First Byte
2024/02/06 08:59:18 Sent Header: Host [api.moby.localhost]
2024/02/06 08:59:18 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/02/06 08:59:18 Send Done
2024/02/06 08:59:18 Recv First Byte       
Eszip extracted successfully inside path /home/deno
2024/02/06 08:59:18 Sent Header: Host [api.moby.localhost]
2024/02/06 08:59:18 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/02/06 08:59:18 Send Done
2024/02/06 08:59:19 Recv First Byte
KyleFontenot commented 9 months ago

So I moved to just storing my edge function source code into a GH repo until this is fixed, and it seems to affecting new deployments too:

Error: entrypoint path does not exist (/home/deno/functions/testedgefunction/index.ts)

Sliver more context: I originally created my edge functions on my Ubuntu machine. Coming back to it today, I got the same error Error: entrypoint path does not exist (/home/deno/functions/testedgefunction/index.ts) when trying to download or redeploy a function I had already set up. I ran supabase login and now I can deploy only on Ubuntu machine, but not download.

mansueli commented 9 months ago

Sliver more context: I originally created my edge functions on my Ubuntu machine. Coming back to it today, I got the same error Error: entrypoint path does not exist (/home/deno/functions/testedgefunction/index.ts) when trying to download or redeploy a function I had already set up. I ran supabase login and now I can deploy only on this machine, but not download.

Hey Kyle, I faced this: Error: entrypoint path does not exist, but then realized that there was a typo in my function name.

Can you try the following:

supabase functions new foo

supabase functions deploy foo

KyleFontenot commented 9 months ago

If I use supabase functions list, it accurately lists my functions and I'm not misspelling them.

supabase functions new testfunction2:

Created new Function at supabase/functions/testfunction2

supabase functions deploy testfunction2:

Bundling testfunction2
Cache Dir /root/.cache/deno/npm
Deploying testfunction2 (script size: 2.633kB)
Deployed Function testfunction2 on project <project_ref>
You can inspect your deployment in the Dashboard: https://supabase.com/dashboard/project/<project_ref>/functions/testfunction2/details
nicolonic commented 9 months ago

Running into the same issue.

CalvinWilkinson commented 8 months ago

I am also running into the same issue.

However, what I get without --legacy-bundle vs with are different. I am running on Windows 11.

Without Legacy Build

```txt supabase functions download update-instructor-ui --project-ref my-proj-ref --legacy-bundle Downloading update-instructor-ui Error downloading function: exit status 1 error: Unable to parse contents of the lockfile "K:\SOFTWARE-DEV\WORK\EAClassManager\deno.lock" Caused by: invalid type: map, expected a string ```

With Legacy Build

```txt supabase functions download update-instructor-ui --project-ref my-proj-ref Downloading update-instructor-ui Eszip extracted successfully inside path /home/deno ```

neoReuters commented 8 months ago

Could you try supabase functions download <name> --legacy-bundle?

We updated the download logic in v1.123.3 so functions deployed using earlier versions of cli would have to specify --legacy-bundle flag when downloading from newer cli.

Fine but what do we do to upgrade our functions to use the new bundling mechanism?

neoReuters commented 8 months ago

FYI, I have this issue when using supabase functions deploy rather than download.

      npm install supabase
      npx supabase link --project-ref $SUPABASE_PROJECT_ID
      npx supabase functions deploy --project-ref $SUPABASE_PROJECT_ID 

Peculiar behaviour because I can deploy locally fine, however via a runner I get this behaviour.

I tried doing a fresh function deploy and I'm still getting that issue.

saullotzof commented 7 months ago

Having the same issues. Any idea of a fix?

santiarr commented 7 months ago

same

saullotzof commented 7 months ago

Created a support ticket with Supabase support today. Really hoping this gets fixed!

santiarr commented 7 months ago

Hope so too! pls update us if you do get it fixed πŸ™

vanandtwocrows commented 7 months ago

Has there been a solution yet? Is this affecting everyone or just some?

Even a download button on the dashboard (edge functions) would be a great intermediate solution.

sweatybridge commented 7 months ago

I haven't been able to reproduce this issue. Could you report the system information to see if we can spot any pattern?

System information

Nepomacs commented 7 months ago

Having the same issue on MacOS and Windows 10, I followed this thread for a few days.

Here are my data, maybe that helps.

Output without debug on Windows 10:

supabase functions download <redacted>
Downloading <redacted>
Eszip extracted successfully inside path /home/deno

Output with debug on Windows 10:

supabase functions download <redacted> --debug
Supabase CLI 1.153.4
Downloading <redacted>
2024/04/05 13:22:10 DNS Start: {Host:api.supabase.com}
2024/04/05 13:22:10 DNS Done: {Addrs:[{IP:172.67.172.49 Zone:} {IP:104.21.30.61 Zone:}] Err:<nil> Coalesced:false}
2024/04/05 13:22:10 Connect Start: tcp 172.67.172.49:443
2024/04/05 13:22:10 Connect Done: tcp 172.67.172.49:443
2024/04/05 13:22:10 TLS Start
2024/04/05 13:22:10 TLS Done: {Version:772 HandshakeComplete:true DidResume:false CipherSuite:4865 NegotiatedProtocol:h2 NegotiatedProtocolIsMutual:true ServerName:api.supabase.com PeerCertificates:[0xc00032f608 0xc00032fb88 0xc000330108 0xc000330688] VerifiedChains:[[0xc000330c08 0xc000331188 0xc000331708 0xc000300588]] SignedCertificateTimestamps:[] OCSPResponse:[<redacted>] TLSUnique:[] ekm:0x1210e80}
2024/04/05 13:22:10 Sent Header: :authority [api.supabase.com]
2024/04/05 13:22:10 Sent Header: :method [GET]
2024/04/05 13:22:10 Sent Header: :path [/v1/projects/<redacted>/functions/<redacted>/body]
2024/04/05 13:22:10 Sent Header: :scheme [https]
2024/04/05 13:22:10 Sent Header: authorization [Bearer <redacted>]
2024/04/05 13:22:10 Sent Header: user-agent [SupabaseCLI/1.153.4]
2024/04/05 13:22:10 Sent Header: accept-encoding [gzip]
2024/04/05 13:22:10 Send Done
2024/04/05 13:22:10 Recv First Byte
2024/04/05 13:22:10 Sent Header: Host [api.moby.localhost]
2024/04/05 13:22:10 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/04/05 13:22:10 Send Done
2024/04/05 13:22:10 Recv First Byte
2024/04/05 13:22:10 Sent Header: Host [api.moby.localhost]
2024/04/05 13:22:10 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/04/05 13:22:10 Sent Header: Content-Length [297]
2024/04/05 13:22:10 Sent Header: Content-Type [application/json]
2024/04/05 13:22:10 Send Done
2024/04/05 13:22:10 Recv First Byte
2024/04/05 13:22:10 Sent Header: Host [api.moby.localhost]
2024/04/05 13:22:10 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/04/05 13:22:10 Sent Header: Content-Length [122]
2024/04/05 13:22:10 Sent Header: Content-Type [application/json]
2024/04/05 13:22:10 Send Done
2024/04/05 13:22:10 Recv First Byte
2024/04/05 13:22:10 Sent Header: Host [api.moby.localhost]
2024/04/05 13:22:10 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/04/05 13:22:10 Sent Header: Content-Length [1997]
2024/04/05 13:22:10 Sent Header: Content-Type [application/json]
2024/04/05 13:22:10 Send Done
2024/04/05 13:22:13 Recv First Byte
2024/04/05 13:22:13 Sent Header: Host [api.moby.localhost]
2024/04/05 13:22:13 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/04/05 13:22:13 Sent Header: Content-Length [0]
2024/04/05 13:22:13 Send Done
2024/04/05 13:22:13 Recv First Byte
2024/04/05 13:22:13 Sent Header: Host [api.moby.localhost]
2024/04/05 13:22:13 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/04/05 13:22:13 Send Done
2024/04/05 13:22:14 Recv First Byte
Eszip extracted successfully inside path /home/deno
2024/04/05 13:22:14 Sent Header: Host [api.moby.localhost]
2024/04/05 13:22:14 Sent Header: User-Agent [Docker-Client/unknown-version (windows)]
2024/04/05 13:22:14 Send Done
2024/04/05 13:22:14 Recv First Byte

Output on MacOS is nearly identical.

Version of OS: Win 10 Pro 22H2 Version of CLI: 1.153.4 Version of Docker: 25.0.3

Output of supabase services

supabase services

        SERVICE IMAGE      β”‚        LOCAL         β”‚  LINKED
  ─────────────────────────┼──────────────────────┼────────────
    supabase/postgres      β”‚ 15.1.1.19            β”‚ 15.1.1.19
    supabase/gotrue        β”‚ v2.143.0             β”‚ v2.145.0
    postgrest/postgrest    β”‚ v12.0.2              β”‚ v12.0.2
    supabase/realtime      β”‚ v2.27.5              β”‚ -
    supabase/storage-api   β”‚ v0.48.2              β”‚ v0.48.2
    supabase/edge-runtime  β”‚ v1.41.3              β”‚ -
    supabase/studio        β”‚ 20240326-5e5586d     β”‚ -
    supabase/postgres-meta β”‚ v0.80.0              β”‚ -
    supabase/logflare      β”‚ 1.4.0                β”‚ -
    bitnami/pgbouncer      β”‚ 1.20.1-debian-11-r39 β”‚ -
    darthsim/imgproxy      β”‚ v3.8.0               β”‚ -
sweatybridge commented 7 months ago

@Nepomacs does it happen with newly deployed function? if not, do you remember if the problematic function was deployed from windows or mac?

Nepomacs commented 7 months ago

@sweatybridge

It does. I just created a new hello-world function and deployed it.

Now trying to download:

supabase functions download hello-world
Downloading hello-world
Eszip extracted successfully inside path /home/deno

Same on Mac.

vanandtwocrows commented 7 months ago

Hey @sweatybridge

Version of OS: Windows 11 Pro 23H2 Version of CLI: 1.153.1 Version of Docker: Docker Desktop 4.28.0

supabase services

        SERVICE IMAGE      β”‚        LOCAL         β”‚  LINKED
  ─────────────────────────┼──────────────────────┼────────────
    supabase/postgres      β”‚ 15.1.1.25            β”‚ 15.1.1.25
    supabase/gotrue        β”‚ v2.145.0             β”‚ v2.145.0
    postgrest/postgrest    β”‚ v12.0.2              β”‚ v12.0.2
    supabase/realtime      β”‚ v2.27.5              β”‚ -
    supabase/storage-api   β”‚ v0.48.2              β”‚ v0.48.2
    supabase/edge-runtime  β”‚ v1.41.2              β”‚ -
    supabase/studio        β”‚ 20240326-5e5586d     β”‚ -
    supabase/postgres-meta β”‚ v0.80.0              β”‚ -
    supabase/logflare      β”‚ 1.4.0                β”‚ -
    bitnami/pgbouncer      β”‚ 1.20.1-debian-11-r39 β”‚ -
    darthsim/imgproxy      β”‚ v3.8.0               β”‚ -

I get the same output as most people here using --debug.

Let me know if there is anything else I can do!

sweatybridge commented 7 months ago

I managed to reproduce this. Will post an update soon

sweatybridge commented 7 months ago

Could you verify if npx supabase@beta functions download fixes the problem?

I will leave this issue open for a few days just in case.

santiarr commented 7 months ago

npx supabase@beta functions download

Awesome, this works!

vanandtwocrows commented 7 months ago

This worked for me too, thank you!

Any chance a feature request could be put in to specify where the download goes to?

Nepomacs commented 7 months ago

Could you verify if npx supabase@beta functions download fixes the problem?

I will leave this issue open for a few days just in case.

Can confirm, it works! Thanks for the effort :-)

lisenpasha commented 7 months ago

Could you verify if npx supabase@beta functions download fixes the problem?

I will leave this issue open for a few days just in case.

This worked but can someone please specify where the downloaded file goes?