kamranahmedse / itomate

Automate your iTerm layouts and session setup
MIT License
336 stars 12 forks source link

All commands throwing an error #25

Closed travisroberts-sf closed 4 years ago

travisroberts-sf commented 4 years ago

When I issue any of the commands available (-c, -h or -n) (but not -v) I am getting the following exception and I'm not really sure where the error is stemming from:

myusernamehere@myusernamehere-ltm Downloads % itomate --help
usage: itomate [-h] [-c CONFIG] [-v] [-n]

Workflow automation and layouts for iTerm

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Path to the configuration file
  -v, --version         Show version
  -n, --new             Run in new window

For details on creating configuration files, please head to:

https://github.com/kamranahmedse/itomate
Traceback (most recent call last):
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/framing.py", line 105, in read
    data = await reader(2)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/asyncio/streams.py", line 677, in readexactly
    raise IncompleteReadError(incomplete, n)
asyncio.streams.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/iterm2/connection.py", line 173, in _async_dispatch_forever
    data = await self.websocket.recv()
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason

Any suggestions? I do have and use PyEnv on my laptop, could that have anything to do with it?

JohnLegrandRichards commented 4 years ago

@travisroberts-sf Are you able to run a .yml file at all or does that fail also?

travisroberts-sf commented 4 years ago

Nope same thing:

myusernamehere@travisrober-ltm Downloads % itomate -c panes-only.yml
Traceback (most recent call last):
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/iterm2/connection.py", line 412, in async_connect
    return await coro(self)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/iterm2/connection.py", line 219, in async_main
    result = await coro(connection)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/itomate/itomate.py", line 200, in activate
    await render_tab_panes(curr_tab, tab_panes, profile_name)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/itomate/itomate.py", line 74, in render_tab_panes
    current_session = await current_session.async_split_pane(vertical=True, profile=pofile_name)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/iterm2/session.py", line 509, in async_split_pane
    result.split_pane_response.status))
iterm2.session.SplitPaneException: INVALID_PROFILE_NAME
Traceback (most recent call last):
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 1051, in read_frame
    extensions=self.extensions,
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/framing.py", line 105, in read
    data = await reader(2)
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/asyncio/streams.py", line 677, in readexactly
    raise IncompleteReadError(incomplete, n)
asyncio.streams.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/iterm2/connection.py", line 173, in _async_dispatch_forever
    data = await self.websocket.recv()
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 509, in recv
    await self.ensure_open()
  File "/Users/myusernamehere/.pyenv/versions/3.7.0/lib/python3.7/site-packages/websockets/protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
myusernamehere@myusernamehere-ltm Downloads %
JohnLegrandRichards commented 4 years ago

@travisroberts-sf Are you sure that the api permissions in iTerm2 were accepted properly?

travisroberts-sf commented 4 years ago

other than checking the box that enables the API is there any other place that needs to be enabled/granted?

travisroberts-sf commented 4 years ago

Any other thoughts of why this would be failing?

JohnLegrandRichards commented 4 years ago

@travisroberts-sf What is your python version and iTerm version? I noticed you also posted an issue that looks like you can now run a file. Is this issue still valid?

travisroberts-sf commented 4 years ago

Yes I got it working. I’m not sure exactly what I did but it works.

On Wed, Aug 26, 2020 at 1:46 PM John Richards notifications@github.com wrote:

@travisroberts-sf https://github.com/travisroberts-sf What is your python version and iTerm version? I noticed you also posted an issue that looks like you can now run a file. Is this issue still valid?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kamranahmedse/itomate/issues/25#issuecomment-681114652, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQX2ZZZEUVLYF6GXIEM3Z43SCVYBFANCNFSM4QLAFGKQ .

--

Travis M. Roberts Sr. Engineer, BT Site Reliability Engineering | Seattle, WA | Salesforce

salesforce mobile: ‭253.290.8477‬ | tableau phone: 206.634.7058 email: travis.roberts@salesforce.com | email: tmroberts@tableau.com

website: salesforce.com https://www.salesforce.com/ | website: tableau.com https://www.tableau.com/

JohnLegrandRichards commented 4 years ago

@travisroberts-sf There is a pull request open that fixes this issue. I was able to reproduce it.

kamranahmedse commented 4 years ago

Thanks, this should be fine in 0.3.9

nerijunior commented 3 years ago

This problem was solved on 0.3.9? I'm with this version and it still happening.

Python 3.8.9 under asdf.

Traceback (most recent call last):
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/iterm2/connection.py", line 421, in async_connect
    return await coro(self)
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/iterm2/connection.py", line 228, in async_main
    result = await coro(connection)
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/itomate/itomate.py", line 192, in activate
    commands.insert(0, f"cd {root_path}")
AttributeError: 'str' object has no attribute 'insert'
Traceback (most recent call last):
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 944, in transfer_data
    message = await self.read_message()
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 1013, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 1089, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 1144, in read_frame
    frame = await Frame.read(
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/websockets/legacy/framing.py", line 70, in read
    data = await reader(2)
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/asyncio/streams.py", line 721, in readexactly
    raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/iterm2/connection.py", line 182, in _async_dispatch_forever
    data = await self.websocket.recv()
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 552, in recv
    await self.ensure_open()
  File "/Users/neri/.asdf/installs/python/3.8.9/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 920, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1000 (OK); no close frame received