Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[APT-18] [Bug] Aptos CLI stopped working without the internet / hangs a lot with slow internet #5909

Closed
mkurnikov opened this issue Dec 17, 2022 · 8 comments
Assignees
Labels
bug Something isn't working move-deps

Comments

@mkurnikov
Copy link
Collaborator

mkurnikov commented Dec 17, 2022

🐛 Bug

Aptos CLI hits the internet on every invocation now, very hard to use on a connection with high latency.

To reproduce

Try to disable your WI-FI and then run the aptos move test command, it now fails with

{
  "Error": "Unexpected error: Unable to resolve packages for package 'PACKAGE_NAME'"
}

With slow internet, it now hangs in the beginning of the call, with nothing relevant in RUST_LOG=debug. I haven't looked at the code, but I remember hearing something about updating dependencies to the latest commit at the branch, maybe it's because of that.

I'm not sure how to fix the behavior with a slow connection. At least allow it to proceed okay if there's no internet.

UPD. While writing the issue, I noticed the new flag

        --skip-fetch-latest-git-deps
            Skip pulling the latest git dependencies
            
            If you don't have a network connection, the compiler may fail due to no ability to pull
            git dependencies.  This will allow overriding this for local development.

which should fix the issue. Could you make it more prominent? Maybe check whether there's a connection, and then enable the flag automatically if there's none?
Or at least fail with a more obvious error in case there's no connection, mentioning the flag.

UPD2. The flag doesn't really work for me though.

APT-18

@mkurnikov mkurnikov added the bug Something isn't working label Dec 17, 2022
@gregnazario
Copy link
Contributor

What's the version of teh CLI?

There is that flag, which should fix the issue. It gets more complicated on checking of there's a connection and then handling it, but I agree a more obvious error should take place.

This was to mainly fix the issue that people had out of date dependencies, which was an entirely different issue, but slow / no internet would cause issues here.

@gregnazario gregnazario self-assigned this Dec 21, 2022
@mkurnikov
Copy link
Collaborator Author

aptos 1.0.2, pre-build release.

$ aptos move test --skip-fetch-latest-git-deps
{
  "Error": "Unexpected error: Unable to resolve packages for package 'Liquidswap'"
}

It's how it behaves now without internet connection.

@geekflyer geekflyer changed the title [Bug] Aptos CLI stopped working without the internet / hangs a lot with slow internet [APT-18] [Bug] Aptos CLI stopped working without the internet / hangs a lot with slow internet Dec 21, 2022
@vivekascoder
Copy link
Contributor

Yeah, I've faced this issue many times, shouldn't it cache the dependency of the project and reuse it without internet?

@github-actions
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

@banool
Copy link
Contributor

banool commented May 9, 2023

We have a similar issue probably with submitting analytics info, see #8113.

@0xmigo
Copy link
Contributor

0xmigo commented Jun 5, 2023

@mkurnikov Hi, I tried aptos move test without internet connection, it works on my side.

Can you show me a step by step on how to repro this? Thanks!

@mkurnikov
Copy link
Collaborator Author

mkurnikov commented Jun 5, 2023

It works on my side with --skip-fetch-latest-git-deps now.

Fails without though, I assume it tries to poll git apis at some point. I've added --skip-fetch-latest-git-deps parameter for my test runs, it's acceptable compromise.
I tried to implement "detect Internet connection" functionality inside the IDE, it's not an ideal solution as it adds additional delay for ICMP call. So it's understandable from Aptos CLI side to not implement that.

I'm closing the issue for now. Thanks everyone!

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Move Language and Runtime Jun 5, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working move-deps
Projects
Archived in project
Development

No branches or pull requests

8 participants