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

Error when copy file from stdin to storage #1129

Closed
shagren opened this issue Oct 23, 2019 · 2 comments · Fixed by #1630
Closed

Error when copy file from stdin to storage #1129

shagren opened this issue Oct 23, 2019 · 2 comments · Fixed by #1630
Assignees
Labels
bug Something isn't working CLIents platform

Comments

@shagren
Copy link
Contributor

shagren commented Oct 23, 2019

> neuro cp /dev/stdin storage://shagren/stdin.txt
Copy file:///dev/stdin => storage://shagren/stdin.txt
stdin [0.00%] 0B of 0B
Hi there
end

Then I pressed Ctrl-D but nothing happens.
I have pressed Ctrl-D again and received error:

ERROR: division by zero
ERROR: Task exception was never retrieved
future: <Task finished coro=<_run_progress.<locals>.wrapped() done, defined at /home/shagren/PycharmProjects/platform-client-python/neuromation/api/storage.py:697> exception=RuntimeError('Session is closed')>
Traceback (most recent call last):
  File "/home/shagren/PycharmProjects/platform-client-python/neuromation/api/storage.py", line 699, in wrapped
    await coro
  File "/home/shagren/PycharmProjects/platform-client-python/neuromation/api/storage.py", line 389, in _upload_file
    self._iterate_file(src_path, dst, progress=progress, queue=queue),
  File "/home/shagren/PycharmProjects/platform-client-python/neuromation/api/storage.py", line 233, in create
    async with self._core.request("PUT", url, data=data, timeout=timeout) as resp:
  File "/usr/lib/python3.7/contextlib.py", line 170, in __aenter__
    return await self.gen.__anext__()
  File "/home/shagren/PycharmProjects/platform-client-python/neuromation/api/core.py", line 121, in request
    timeout=timeout,
  File "/home/shagren/PycharmProjects/platform-client-python/venv/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/home/shagren/PycharmProjects/platform-client-python/venv/lib/python3.7/site-packages/aiohttp/client.py", line 357, in _request
    raise RuntimeError('Session is closed')
RuntimeError: Session is closed
@serhiy-storchaka
Copy link
Contributor

I get a division-by-zero error.

ERROR: division by zero
Traceback (most recent call last):
  File "/home/serhiy/neuromation/platform-client-python/neuromation/cli/main.py", line 296, in main
    cli.main(args=args, standalone_mode=False)
  File "/home/serhiy/neuromation/platform-client-python/venv/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/serhiy/neuromation/platform-client-python/venv/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/serhiy/neuromation/platform-client-python/venv/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/serhiy/neuromation/platform-client-python/venv/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/serhiy/neuromation/platform-client-python/venv/lib/python3.6/site-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/home/serhiy/neuromation/platform-client-python/neuromation/cli/utils.py", line 191, in wrapper
    debug=root.verbosity >= 2,  # see main:setup_logging for constants
  File "/home/serhiy/neuromation/platform-client-python/neuromation/cli/asyncio_utils.py", line 63, in run
    return loop.run_until_complete(main_task)
  File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/home/serhiy/neuromation/platform-client-python/neuromation/cli/utils.py", line 139, in _run_async_function
    return await func(root, *args, **kwargs)
  File "/home/serhiy/neuromation/platform-client-python/neuromation/cli/storage.py", line 330, in cp
    src, dst, update=update, progress=progress_obj
  File "/home/serhiy/neuromation/platform-client-python/neuromation/api/storage.py", line 374, in upload_file
    queue, self._upload_file(path, dst, progress=progress, queue=queue)
  File "/home/serhiy/neuromation/platform-client-python/neuromation/api/storage.py", line 710, in _run_progress
    cb(data)
  File "/home/serhiy/neuromation/platform-client-python/neuromation/cli/formatters/storage.py", line 733, in step
    progress = (100 * data.current) / data.size
ZeroDivisionError: division by zero

@serhiy-storchaka serhiy-storchaka self-assigned this Oct 23, 2019
@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLIents platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants