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

'bytes' object has no attribute 'encode' #202

Open
EasyLOB opened this issue Nov 21, 2024 · 4 comments
Open

'bytes' object has no attribute 'encode' #202

EasyLOB opened this issue Nov 21, 2024 · 4 comments

Comments

@EasyLOB
Copy link

EasyLOB commented Nov 21, 2024

Hi,
I configured MKTXP with Docker and the parameters below.
I have access to MIKROTIK API using ssh and API is enabled.
But I get the error below.
What is wrong?
Thanks

Connecting to router [email protected]
2024-11-21 23:37:59 Connection to router [email protected] has failed: 'bytes' object has no attribute 'encode'
Failed attemp to establish network connection to router: [email protected]
2024-11-21 23:37:59 Running HTTP metrics server on: 0.0.0.0:49090
sudo docker run --name xmktxp \
  -v "/var/devops/mktxp:/home/mktxp/mktxp/" \
  -p 49090:49090 \
  -it \
  --rm ghcr.io/akpw/mktxp:latest
[mikrotik-white]
    hostname = 192.168.167.12
    username = admin
    password = PASSWORD

[default]
    user = True
    routing_stats = False
    ssl_certificate_verify = False
    switch_port = False
    lte = False
    no_ssl_certificate = False
    check_for_updates = False
    wireless_clients = True
    ipv6_firewall = False
    plaintext_login = True
    queue = True
    firewall = True
    pool = True
    ipv6_neighbor = False
    capsman_clients = True
    interface = True
    connection_stats = False
    poe = True
    installed_packages = True
    netwatch = True
    use_ssl = False
    neighbor = True
    enabled = True
    ipv6_pool = False
    use_comments_over_names = True
    route = True
    wireless = True
    monitor = True
    kid_control_assigned = False
    certificate = False
    capsman = True
    dhcp = True
    bgp = False
    kid_control_dynamic = False
    ipv6_route = False
    ipsec = False
    connections = True
    dhcp_lease = True
    public_ip = True
    hostname = localhost
    username = user
    password = password
    remote_dhcp_entry = None
    remote_capsman_entry = None
    port = 8728
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 526.0
python_gc_objects_collected_total{generation="1"} 0.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable objects found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 22.0
python_gc_collections_total{generation="1"} 1.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="13",patchlevel="0",version="3.13.0"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 4.2643456e+07
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 3.0101504e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.73223195899e+09
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.5800000000000001
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 21.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
@Brandonza
Copy link

Which version of RouerOS are you using?

@EasyLOB
Copy link
Author

EasyLOB commented Nov 22, 2024

MikroTik RouterOS 6.42.11 (c) 1999-2018

@EasyLOB
Copy link
Author

EasyLOB commented Nov 23, 2024

Hi,
Is the problem related to RouteOS version?
Thanks

@akpw
Copy link
Owner

akpw commented Nov 25, 2024

looks encoding relate, do you have non-ascii characters in your router's data?
there was an attempt to address that problem in the past, which mostly worked till now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants