question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(Regression?) TypeError on pio remote run --target upload

See original GitHub issue

What kind of issue is this?

  • PlatformIO Core. If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Remote: Debian (Beaglebone) Local: macOS 10.14.6 (18G84)

PlatformIO Version (platformio --version): Remote and local: PlatformIO, version 4.0.1b3

Description of problem

pio remote run --upload fails due to a TypeError. Might be a duplicate of #2223.

Steps to Reproduce

  1. on remote: pio remote agent start
  2. on local: pio remote run --target upload
  3. “Agent has been terminated” with the tracelog:
2019-08-02 14:01:41 [info] Remote command received: psync
Peer will receive following PB traceback:
Unhandled Error
Traceback (most recent call last):
  File "/home/debian/.platformio/packages/contrib-pysite/twisted/spread/banana.py", line 173, in gotItem
    self.callExpressionReceived(item)
  File "/home/debian/.platformio/packages/contrib-pysite/twisted/spread/banana.py", line 136, in callExpressionReceived
    self.expressionReceived(obj)
  File "/home/debian/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 621, in expressionReceived
    method(*sexp[1:])
  File "/home/debian/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 1025, in proto_message
    self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
--- <exception caught here> ---
  File "/home/debian/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 1054, in _recvMessage
    netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
  File "/home/debian/.platformio/packages/contrib-pysite/twisted/spread/flavors.py", line 125, in remoteMessageReceived
    state = method(*args, **kw)
  File "<string>", line 41, in remote_acwrite

  File "<string>", line 276, in ac_write

  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
builtins.TypeError: the JSON object must be str, not 'bytes'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ivankravetscommented, Dec 27, 2019

@xilart This is a bug. Please open a new issue. Thanks!

0reactions
xilartcommented, Dec 27, 2019

Hi @ivankravets , unfortunately the problem persists with python3.7 (Win10-PC) on client and python3.5 (RPi). It’s interesting that when I had mixed versions then “remote monitor” and “remote device” commands in PIO failed. Now “remote monitor” and “remote device” work fine, but once I try “remote upload” - it fails with two different error types:

  1. Initial attempt Client:
Uploading firmware remotely
Agent has been terminated
The terminal process terminated with exit code: 1

Server

2019-12-27 16:30:38 [info] Remote command received: psync
Peer will receive following PB traceback:
Unhandled Error
Traceback (most recent call last):
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/banana.py", line 173, in gotItem
    self.callExpressionReceived(item)
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/banana.py", line 136, in callExpressionReceived
    self.expressionReceived(obj)
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 621, in expressionReceived
    method(*sexp[1:])
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 1025, in proto_message
    self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
--- <exception caught here> ---
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 1054, in _recvMessage
    netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/flavors.py", line 125, in remoteMessageReceived
    state = method(*args, **kw)
  File "<string>", line 46, in remote_acwrite
    
  File "<string>", line 282, in ac_write
    
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
builtins.TypeError: the JSON object must be str, not 'bytes'
  1. …and next attempt: Client:
Uploading firmware remotely
b'dictionary changed size during iteration'
The terminal process terminated with exit code: 1`

Server:

2019-12-27 16:28:47 [info] Remote command received: psync
2019-12-27 16:28:47 [info] Terminate previous Project Sync process
Peer will receive following PB traceback:
Unhandled Error
Traceback (most recent call last):
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/banana.py", line 173, in gotItem
    self.callExpressionReceived(item)
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/banana.py", line 136, in callExpressionReceived
    self.expressionReceived(obj)
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 621, in expressionReceived
    method(*sexp[1:])
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 1025, in proto_message
    self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
--- <exception caught here> ---
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/pb.py", line 1054, in _recvMessage
    netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
  File "/root/.platformio/packages/contrib-pysite/twisted/spread/flavors.py", line 125, in remoteMessageReceived
    state = method(*args, **kw)
  File "<string>", line 60, in remote_cmd
    
  File "<string>", line 88, in _process_cmd_psync
    
builtins.RuntimeError: dictionary changed size during iteration

How can I fix it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pio remote run — PlatformIO latest documentation
Custom upload port of embedded board. To print all available ports use pio remote device command. If upload port is not specified, PlatformIO...
Read more >
Untitled
Gta 5 damage patch, Deadline 2012 moviemeter, 22648 train running status, ... Upload gallery, Dragon age 3 inquisition leliana, Capone bege vs marines, ......
Read more >
kernel SPEC - CentOS Git server
You'll want to install this package if you need a reference to the options that can be passed to Linux kernel modules at...
Read more >
sitemap-questions-44.xml - Stack Overflow
... /390135/inserting-a-comment-in-docx-file-around-a-text-inside-a-run 2021-12-28 ... /how-to-connect-to-remote-oracle-db-with-pl-sql-developer 2021-12-28 ...
Read more >
Untitled
(Eugene Loh) [Orabug: 32148161] - Load pre-compiled BPF functions even if they ... Add box_offsets for free-running counters (Kan Liang) [Orabug: 32020885] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found