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

Flutter Install Failed on Ubuntu #56

Open
Vayth opened this issue May 14, 2020 · 27 comments
Open

Flutter Install Failed on Ubuntu #56

Vayth opened this issue May 14, 2020 · 27 comments

Comments

@Vayth
Copy link

Vayth commented May 14, 2020

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.

@ced455
Copy link

ced455 commented May 18, 2020

same issue here

@Max-Might
Copy link

Same issue :(

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

@Max-Might
Copy link

@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
Copy link

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

@hey24sheep
Copy link

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

@Vayth
Copy link
Author

Vayth commented Jun 16, 2020

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.

@hey24sheep
Copy link

hey24sheep commented Jun 16, 2020

@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.

@Vayth
Copy link
Author

Vayth commented Jun 16, 2020

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.

@hey24sheep
Copy link

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

@hey24sheep
Copy link

@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.

@Max-Might
Copy link

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
Copy link

Max-Might commented Jun 18, 2020

@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.

@hey24sheep
Copy link

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

@stephenmichaelf
Copy link

@hey24sheep We have now released the lib.

@hey24sheep
Copy link

@stephenmichaelf Yayy, Thanks 👍

@Vayth Try now its fixed pushed.

@Vayth
Copy link
Author

Vayth commented Jun 18, 2020

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.

@Max-Might
Copy link

@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.

@hey24sheep
Copy link

hey24sheep commented Jun 19, 2020 via email

@Nash0x7E2
Copy link

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

@Max-Might
Copy link

Max-Might commented Sep 1, 2020

@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.

@hey24sheep
Copy link

@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.

@Nash0x7E2
Copy link

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

@hey24sheep
Copy link

hey24sheep commented Sep 2, 2020

@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

@Nash0x7E2
Copy link

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

@hey24sheep
Copy link

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

@elpablete
Copy link

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

@hey24sheep
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants