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

Container fails to start #39

Closed
Benuhx opened this issue Dec 3, 2020 · 3 comments
Closed

Container fails to start #39

Benuhx opened this issue Dec 3, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@Benuhx
Copy link

Benuhx commented Dec 3, 2020

Describe the bug
mi-scale Version: 0.1.14

Container fails to start with the following exception:

2020-12-03 16:14:48 - Starting Xiaomi mi Scale...
2020-12-03 16:14:48 - Loading Config From OS Environment...
Traceback (most recent call last):
  File "/opt/miscale/Xiaomi_Scale.py", line 28, in <module>
    with open('/data/options.json') as json_file:
FileNotFoundError: [Errno 2] No such file or directory: '/data/options.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/miscale/Xiaomi_Scale.py", line 165, in <module>
    if MQTT_DISCOVERY.lower() in ['true', '1', 'y', 'yes']:
AttributeError: 'bool' object has no attribute 'lower'

To Reproduce
Start mi-scale with the following docker-compose:

version: "3.5"
services:
   mi-scale:
      image: lolouk44/xiaomi-mi-scale:latest
      container_name: mi-scale
      restart: always
      depends_on:
        - mos
      network_mode: host
      privileged: true

      environment:
      - MISCALE_MAC=C4:27:9B:B6:AE:10
      - MQTT_HOST=127.0.0.1
      - MQTT_PREFIX=miScale
      - USER1_GT=70
      - USER1_SEX=male
      - USER1_NAME=Benuhx
      - USER1_HEIGHT=183
      - USER1_DOB=1990-01-01

Run docker logs mi-scale to display the exception

Desktop/Server (please complete the following information):
Docker-compose with Raspberry pi 4 and built-in Bluetooth

Additional Information:
Seems to be the same issue as #31 but the bug is not fixed for me. I've double checked my mi-scale version, it is definitly the latest version 0.1.14 created 7 day ago:

docker images shows:

REPOSITORY                                       TAG                 IMAGE ID            CREATED             SIZE
lolouk44/xiaomi-mi-scale                   latest              ffe67ecaf549        7 days ago          318MB
@Benuhx Benuhx added the bug Something isn't working label Dec 3, 2020
@lolouk44
Copy link
Owner

lolouk44 commented Dec 3, 2020

Hi @Benuhx ,

Nice to see you again 😃

You're missing some stuff in your docker-compose.
Please look at the docker-compose section and add the missing bits. Set them to false if you don't use them
I'll see if I can add a better handler for missing config bits

@Benuhx
Copy link
Author

Benuhx commented Dec 3, 2020

Hi @lolouk44

thanks for your quick response 😀.

I've updated the enviroment section in the docker-compose. The container starts and the messages are published with MQTT 😁

For refererence my new docker-compose:

version: "3.5"
services:
    mi-scale:
      image: lolouk44/xiaomi-mi-scale:latest
      container_name: mi-scale
      restart: always
      depends_on:
        - mos
      network_mode: host
      privileged: true

      environment:
      - HCI_DEV=hci0
      - MISCALE_MAC=C4:27:9B:B6:AE:10
      - MQTT_HOST=127.0.0.1
      - MQTT_PORT=1883
      - MQTT_PREFIX=miScale
      - TIME_INTERVAL=30
      - MQTT_DISCOVERY=true
      - USER1_GT=70
      - USER1_SEX=male
      - USER1_NAME=Benuhx
      - USER1_HEIGHT=183
      - USER1_DOB=1990-01-01

@Benuhx Benuhx closed this as completed Dec 3, 2020
@atv2016
Copy link

atv2016 commented Feb 18, 2024

So what are the bits that changed? And what is the mos service? I am getting the same as you it can't seem to find options.json..

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

No branches or pull requests

3 participants