vsts-flutter-tasks icon indicating copy to clipboard operation
vsts-flutter-tasks copied to clipboard

Flutter Install Failed on Ubuntu

Open Vayth opened this issue 5 years ago • 27 comments
trafficstars

On ubuntu-latest agent, I got this error when executing Flutter Install.

Starting: FlutterInstall
==============================================================================
Task         : Flutter Install
Description  : Install the Flutter environment.
Version      : 0.2.35
Author       : Aloïs Deniel
Help         : For more information, take a look at the Flutter [documentation](https://flutter.io)
==============================================================================
Downloading: https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_1.17.1-stable.tar.xz
Extracting archive
/usr/bin/unzip /home/vsts/work/_temp/e606a105-28f8-4b64-9a04-8421883bf27c
Archive:  /home/vsts/work/_temp/e606a105-28f8-4b64-9a04-8421883bf27c

  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/vsts/work/_temp/e606a105-28f8-4b64-9a04-8421883bf27c or
        /home/vsts/work/_temp/e606a105-28f8-4b64-9a04-8421883bf27c.zip, and cannot find /home/vsts/work/_temp/e606a105-28f8-4b64-9a04-8421883bf27c.ZIP, period.
##[error]Error: The process '/usr/bin/unzip' failed with exit code 9
Finishing: FlutterInstall

It runs normally on macos-latest. Not sure whether the linux package itself is broken or what, but I thought I should ask here first.

Vayth avatar May 14 '20 12:05 Vayth

same issue here

ced455 avatar May 18 '20 14:05 ced455

Same issue :(

Is there any workaround for this? Using different ubuntu version or flutter version?

Max-Might avatar Jun 04 '20 11:06 Max-Might

@aloisdeniel I think I found the problem. Flutter uses ZIP files for Mac and Windows releases and Tar files for linux.

This has to be changed to use tool.extractTar() for Linux builds.

This will enable the extension to be used on Linux build runners.

Max-Might avatar Jun 04 '20 11:06 Max-Might

So I opened pull request #57 that should fix the issue. I did not test it though.

Max-Might avatar Jun 04 '20 17:06 Max-Might

Fixed it on mine I do not have a linux pipeline. You could test and let me know. Credit to @Max-Might

hey24sheep avatar Jun 15 '20 09:06 hey24sheep

Thanks, @hey24sheep . Unfortunately, for some strange reason, my pipeline keep using version 0.2.34 even though I have installed latest (0.2.35) and it still failed.

However, looking at your code, seems like you still use the zip path. Maybe you should refer to flutter json like the one used in alois' fix of path issue back then ( http://storage.googleapis.com/flutter_infra/releases/releases_$(arch).json )

By the way, I couldn't find issue tab on your repo, so do we just report yours here as well? It'd be better if you could become a maintainer here too so we don't have multiple extension.

Vayth avatar Jun 16 '20 02:06 Vayth

@Vayth You couldn't update your pipeline maybe b'cuz you are using Alois's extension.

Flutter json have the same zip path. Alois does that same path too. I don't think it is the reason of failing. PS: I have updated my code, PRs are welcomed. Test and let me know :)

By the way, I couldn't find issue tab on your repo, so do we just report yours here as well? It'd be better if you could become a maintainer here too so we don't have multiple extension.

I have my own extension, there are a few reasons. Alois is busy, and I have seen issues pending for months here. Also, We use this extension in our builds and my boss said to have our own for future sake. So, best way to keep our builds successful is to have our own extension which if even fails we can fix asap. Also, I do not want to throw my updates on existing users and break their builds.

I have intentionally forked this repo to keep credits to people and transparency. I know there is no issue page but PRs are always welcome :) and I don't think I can be a maintainer here, because I opened an issue here months ago and I said the same thing. But, it was stale and then closed by owner after I created mine. Like your own issue is May 14 and its been a month. In production environment it's difficult to depend on 3rd party. I hope you understand my view.

hey24sheep avatar Jun 16 '20 10:06 hey24sheep

No, I was using your fork in my test org and verified it to be 0.2.35, yet the one in pipeline run log showed 0.2.34. I think pipeline need some time to adjust the version. Now it's correctly state 0.2.35.

However, I still have problem extracting it.

Starting: FlutterInstall
==============================================================================
Task         : Flutter Install Task
Description  : Install the Flutter environment.
Version      : 0.2.35
Author       : Hey24sheep
Help         : For more information, take a look at the Flutter [documentation](https://flutter.io)
==============================================================================
(node:3656) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3656) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3656) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3656) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3656) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3656) Warning: Use Cipheriv for counter mode of aes-256-ctr
Downloading: https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_1.17.3-stable.tar.xz
Extracting archive
/bin/tar xzC /home/vsts/work/_temp/25177519-c871-42ee-9a0b-bb68d8475311 -f /home/vsts/work/_temp/1c6e50c0-2e07-43ca-b748-8f7a3de5f6bd

gzip: stdin: not in gzip format
/bin/tar: Child returned status 1
/bin/tar: Error is not recoverable: exiting now
##[error]Error: /bin/tar failed with return code: 2
Finishing: FlutterInstall

I believe it should use tar -xf instead of tar -xzf like in the log.

Vayth avatar Jun 16 '20 14:06 Vayth

@Vayth I don't think we can change those args, there is no option. Here is the code for extractZip

hey24sheep avatar Jun 17 '20 10:06 hey24sheep

@Vayth I have updated my extension, let me know if it works now. I have changed extract to 7z as per wiki it supports .xz and tar. So, it should work now.

hey24sheep avatar Jun 17 '20 12:06 hey24sheep

From the extract7z() implementation:

if (process.platform != 'win32') {
    throw new Error('extract7z() not supported on current OS');
}

So this will work only on windows hosts, unfortunately (if it works, I can't test it).

Max-Might avatar Jun 18 '20 10:06 Max-Might

@hey24sheep @Vayth OK, it looks like someone just removed the z flag from the tool lib function so extractTar() should work now with the tar.xz file.

Max-Might avatar Jun 18 '20 11:06 Max-Might

Hi, @Max-Might I see. But, they haven't released the update on npm yet

hey24sheep avatar Jun 18 '20 13:06 hey24sheep

@hey24sheep We have now released the lib.

stephenmichaelf avatar Jun 18 '20 13:06 stephenmichaelf

@stephenmichaelf Yayy, Thanks 👍

@Vayth Try now its fixed pushed.

hey24sheep avatar Jun 18 '20 15:06 hey24sheep

Alright, it's installed and built successfully. Thanks a lot, @hey24sheep , @Max-Might , @stephenmichaelf !

Now I wonder if this issue should be closed or not, since alois' version here is not fixed yet. I think we should close this once the fix got merged.

Vayth avatar Jun 18 '20 18:06 Vayth

@Vayth Yep, I updated my PR to use the new version of the azure pipelines tool lib. Now it is up to @aloisdeniel to review it when he has some spare time. Thanks for testing the changes.

Max-Might avatar Jun 19 '20 10:06 Max-Might

Thanks everyone

On Fri, Jun 19, 2020, 4:28 PM Костадин Дамянов [email protected] wrote:

@Vayth https://github.com/Vayth Yep, I updated my PR to use the new version of the azure pipelines tool lib. Now it is up to @aloisdeniel https://github.com/aloisdeniel to review it when he has some spare time. Thanks for testing the changes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aloisdeniel/vsts-flutter-tasks/issues/56#issuecomment-646573325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHQCT5SUCA5HKLJNSKNP2MLRXNAEJANCNFSM4NAVGEFA .

hey24sheep avatar Jun 19 '20 15:06 hey24sheep

This appears to still be occurring. Encountered while trying to install the latest dev version.

Error:

unzip:  cannot find zipfile directory in one of /home/vsts/work/_temp/02249d3f-cd47-4be0-a418-7064fbfe6e92 or
        /home/vsts/work/_temp/02249d3f-cd47-4be0-a418-7064fbfe6e92.zip, and cannot find /home/vsts/work/_temp/02249d3f-cd47-4be0-a418-7064fbfe6e92.ZIP, period

Nash0x7E2 avatar Aug 31 '20 18:08 Nash0x7E2

@Nash0x7E2 There is a pending PR #57 that fixes the issue. We need @aloisdeniel (or someone else who has the permission) to merge it and upload it to Azure.

Max-Might avatar Sep 01 '20 07:09 Max-Might

@Nash0x7E2 you could use my ext for the time being if you want. I do not know when it will be fixed here. If the issue exists on my fork as well, let me know.

hey24sheep avatar Sep 01 '20 08:09 hey24sheep

Thanks @hey24sheep! Is it possible to add support for master on your fork? Building for web is currently not supported on dev :/

Nash0x7E2 avatar Sep 01 '20 22:09 Nash0x7E2

@Nash0x7E2 I have master on my fork. There is no dev branch.

Building for web is currently not supported on dev :/

What do you mean by this?

If you are looking for extension here is the link

hey24sheep avatar Sep 02 '20 04:09 hey24sheep

@hey24sheep I mean installing Flutter from the master channel and building Flutter web

Nash0x7E2 avatar Sep 02 '20 20:09 Nash0x7E2

But you could just download the extension on your azure account and it will work. @Nash0x7E2 and I already have master channel and it works. I don't understand what you want to do

hey24sheep avatar Sep 03 '20 05:09 hey24sheep

Any update on the "official vsts task"? or I'm not understanding which version is the "official" between @hey24sheep 's and @aloisdeniel 's ?

elpablete avatar Apr 23 '21 15:04 elpablete

@elpablete this one is original but not maintained repository. I have the fork which I maintain. I have been asked to make my fork into a separate repository but I have not done it because of different reasons it's been discussed on my fork issues section

hey24sheep avatar Apr 23 '21 15:04 hey24sheep