nextstrain / cli

The Nextstrain command-line interface (CLI)—a program called nextstrain—which aims to provide a consistent way to run and visualize pathogen builds and access Nextstrain components like Augur and Auspice across computing environments such as Docker, Conda, and AWS Batch.
https://docs.nextstrain.org/projects/cli/
MIT License
27 stars 20 forks source link

BUG: Uninformative `Error: The connection to the remote server was severed before the upload finished.` #202

Closed corneliusroemer closed 2 years ago

corneliusroemer commented 2 years ago

Current Behavior

Error: The connection to the remote server was severed before the upload finished.

Expected behavior

Upload works or I get a meaningful/helpful error message with sufficient detail

How to reproduce

No idea how to reproduce, could well be that I don't have credentials - I copied my AWS credentials from local computer to AWS (where I'm doing the upload) but the error message doesn't say what the problem could be

Your environment

Additional context

nextstrain login didn't work as I couldn't figure out my password

so this could be as simple as not having been authenticated, though in that case the error is wrong anyways.

Full command and log

(nextstrain) ubuntu@ip-172-31-15-175:~/ncov-simple-daily-builds$ nextstrain remote upload nextstrain.org/groups/neherlab/ncov/belgium auspice-combined/belgium/latest/ncov_belgium.json auspice-combined/belgium/latest/ncov_belgium_root-sequence.json auspice-combined/belgium/latest/ncov_belgium_tip-frequencies.json 2>&1
Uploading auspice-combined/belgium/latest/ncov_belgium.json as https://nextstrain.org/groups/neherlab/ncov/belgium
Error: The connection to the remote server was severed before the
upload finished.

Retrying may help if the problem happens to be transient (e.g. a
network error like a lost wifi signal), or there might be a bug
somewhere that needs to be fixed.

If retrying after a bit doesn't help, please open a new issue
at <https://github.com/nextstrain/cli/issues/new/choose> and
include the complete output above and the command you were
running.

@tsibley

tsibley commented 2 years ago

The primary issue is almost certainly that you're not logged in, as uploading requires you be. nextstrain whoami will report "Not logged in.". You say you made your AWS credentials available, but the neherlab group doesn't use those anymore (remember?); you need to use nextstrain login.

The secondary issue is a server-side bug that severs the connection instead of properly returning the "not authorized" response. This is fixed by https://github.com/nextstrain/nextstrain.org/pull/565, but that's been awaiting review for ~2 weeks. I'll likely go ahead and merge and deploy it without review today.

The error message itself correctly describes what happened; the secondary issue masks the primary issue here. The message was introduced in response to https://github.com/nextstrain/cli/issues/189.