Balena services downloaded but no running!

Hey there!
I’m having a problem with containers on balena Cloud. I made the push in balena-cli and in balenaCloud it only shows “downloaded” and not “running”, what can it be?

i’m trying run multiple containers on raspberry pi 4

log only appear “Intalling service …”

Hello, Just a thought but are you using any depends_on options in your docker-compose file? If not, feel free to enable support access and provide the UUID and we will take a look.

Hi. i have the exact some problem. it was all working fine until this release. now it is stuck on “downloading”. were you able to resolve it?

Hello @tjb Did a reboot solves the issue?

Feel free to grant support access and share the UUID or URL of your device over DM on the forums :slight_smile:

Hi, yes i tried several times. i will DM you and give support access.

Thanks

@tjb did this device worked before? I see that you use CM4. Or did you change anything?

I enabled support and sent the link in DM. I was reading the logs but I still couldn’t solve it.

journalctl --all -n 100 -u balena

output →

1 Like

That is very useful @RonaldGuilhermePDS actually according to our docs you can only use “specific network names” and we don’t support env var. Could you please change that and see if then it works?

impressive! after reading in the documentation the fields that are not supported, the services ran without problem.

1 Like

How did you solve the problem @RonaldGuilhermePDS ?

I removed the following fields that according to the documentation are not supported and edited the volume path.

image

image

1 Like

Thanks for sharing :slight_smile:

@mpous no, nothing was changed other than pushing a code update

journalctl --all -n 100 -u balena

output →

Connecting to 62c0bdedc81eb2eb43b1d0026732b000...
Spawning shell...
=============================================================
    Welcome to balenaOS
=============================================================
root@62c0bde:~# journalctl --all -n 100 -u balena
-- Logs begin at Wed 2022-05-25 08:30:37 UTC, end at Thu 2022-05-26 10:22:54 UTC. --
May 26 10:01:09 62c0bde 0b5baf9964f0[1588]: [debug]   Container log timestamp flush complete
May 26 10:03:25 62c0bde balenad[1646]: time="2022-05-26T10:03:25.204280800Z" level=info msg="shi>
May 26 10:03:26 62c0bde balenad[1646]: time="2022-05-26T10:03:26.405483127Z" level=info msg="shi>
May 26 10:03:26 62c0bde balenad[1588]: time="2022-05-26T10:03:26.410794616Z" level=info msg="ign>
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [info]    Applying target state
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]   Scheduling another update attempt in 90000>
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]         at JSON.parse (<anonymous>)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at ConfigTxt.processConfigVarValue (/u>
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:10:2550356
lines 1-10...skipping...
-- Logs begin at Wed 2022-05-25 08:30:37 UTC, end at Thu 2022-05-26 10:22:54 UTC. --
May 26 10:01:09 62c0bde 0b5baf9964f0[1588]: [debug]   Container log timestamp flush complete
May 26 10:03:25 62c0bde balenad[1646]: time="2022-05-26T10:03:25.204280800Z" level=info msg="shim balena-engine-containerd-shim started" address=/containerd-shim/8e9f3d48336f59702e8c7f04dd3eedf05684f>
May 26 10:03:26 62c0bde balenad[1646]: time="2022-05-26T10:03:26.405483127Z" level=info msg="shim reaped" id=922cec87063701c8da4a2b87ab16e13ff5d238d6de2da46a32f22526dc1603fa
May 26 10:03:26 62c0bde balenad[1588]: time="2022-05-26T10:03:26.410794616Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [info]    Applying target state
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]   Scheduling another update attempt in 900000ms due to failure:  SyntaxError: Unexpected token “ in JSON at position 16
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]         at JSON.parse (<anonymous>)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at ConfigTxt.processConfigVarValue (/usr/src/app/dist/app.js:10:2563349)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:10:2550356
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:2:101893
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:2:54430
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at baseForOwn (/usr/src/app/dist/app.js:2:31343)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at Function.lodash.mapValues (/usr/src/app/dist/app.js:2:101820)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:2:48870
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at arrayReduce (/usr/src/app/dist/app.js:2:10579)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at baseWrapperValue (/usr/src/app/dist/app.js:2:48806)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at LodashWrapper.lodash.toJSON.lodash.valueOf.lodash.value (/usr/src/app/dist/app.js:2:134888)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at Object.exports.envToBootConfig (/usr/src/app/dist/app.js:10:2550392)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at bootConfigChangeRequired (/usr/src/app/dist/app.js:6:275329)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at changeRequired (/usr/src/app/dist/app.js:6:277255)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at getBackendSteps (/usr/src/app/dist/app.js:6:276958)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at async Object.exports.getRequiredSteps (/usr/src/app/dist/app.js:6:282233)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]   Device state apply error SyntaxError: Unexpected token “ in JSON at position 16
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]         at JSON.parse (<anonymous>)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at ConfigTxt.processConfigVarValue (/usr/src/app/dist/app.js:10:2563349)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:10:2550356
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:2:101893
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at /usr/src/app/dist/app.js:2:54430
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at baseForOwn (/usr/src/app/dist/app.js:2:31343)
May 26 10:03:39 62c0bde 0b5baf9964f0[1588]: [error]       at Function.lodash.mapValues (/usr/src/app/dist/app.js:2:101820)

root@62c0bde:~#

Thanks for reverting back, can you send your docker-compose.yml file and the output of this query. This API call needs to run on the device: Interacting with the balena Supervisor - Balena Documentation

I am trying to see what’s the issue supervisor is pointing out in the target state. Thanks!

thanks @vipulgupta2048. here is the docker-compose.yml file. the one running on the system now is just the USP-IP service.

version: '2.1'

services:
  USB-IP:
    build: ./USB-IP
    network_mode: host
    privileged: true
    restart: always
    environment:
      - 'DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket'
    labels:
      io.balena.features.dbus: '1'
      io.balena.features.kernel-modules: "1"
      io.balena.features.sysfs: "1"
      io.balena.features.supervisor-api: "1"
  wifi-repeater:
    build: ./wifi
    privileged: true
    labels:
      io.balena.features.dbus: '1'

Thank you for sharing that @tjb, could you also go to your device page and under Diagnostics > Supervisor State and paste the contents under Target supervisor state? This looks like a syntax error in the definition in a config variable, but looking at the state will tell us more.

hi @pipex please see as requested. i had to do some config to get the usb to work on the CM4 dev board. but it was working for a number of releases.

{
  "local": {
    "name": "aged-moon",
    "config": {
      "RESIN_SUPERVISOR_DELTA_VERSION": "3",
      "RESIN_SUPERVISOR_NATIVE_LOGGER": "true",
      "RESIN_HOST_CONFIG_arm_64bit": "1",
      "RESIN_HOST_CONFIG_disable_splash": "1",
      "RESIN_HOST_CONFIG_dtoverlay": "\"vc4-fkms-v3d\",“dwc2,dr_mode=host”",
      "RESIN_HOST_CONFIG_dtparam": "\"i2c_arm=on\",\"spi=on\",\"audio=on\"",
      "RESIN_HOST_CONFIG_enable_uart": "1",
      "RESIN_HOST_CONFIG_gpu_mem": "16",
      "RESIN_HOST_FIREWALL_MODE": "",
      "RESIN_SUPERVISOR_DELTA": "1",
      "RESIN_SUPERVISOR_POLL_INTERVAL": "900000",
      "RESIN_SUPERVISOR_DELTA_REQUEST_TIMEOUT": "59000"
    },
    "apps": {
      "1930096": {
        "releaseId": 2174693,
        "commit": "5cfface507a0b1226b5e47dfd0b04735",
        "name": "Universal_Payload_OS",
        "services": {
          "1574448": {
            "privileged": true,
            "labels": {
              "io.balena.features.dbus": "1"
            },
            "imageId": 4937833,
            "serviceName": "wifi-repeater",
            "image": "registry2.balena-cloud.com/v2/9b5646c0c8d8e3dac336979f264daad9@sha256:bf0c865b2a6d1cda23e82f39ed3ba1818f04410d8b17c26217c9937979b05d55",
            "running": true,
            "environment": {
              "AP_PASSWORD": "removed",
              "AP_SSID": "UniPayload",
              "WIFI_PASSWORD": "removed",
              "WIFI_SSID": "UniPayload"
            }
          },
          "1578685": {
            "network_mode": "host",
            "privileged": true,
            "restart": "always",
            "environment": {
              "DBUS_SYSTEM_BUS_ADDRESS": "unix:path=/host/run/dbus/system_bus_socket",
              "AP_PASSWORD": "removed",
              "AP_SSID": "UniPayload",
              "WIFI_PASSWORD": "removed",
              "WIFI_SSID": "UniPayload"
            },
            "labels": {
              "io.balena.features.dbus": "1",
              "io.balena.features.kernel-modules": "1",
              "io.balena.features.supervisor-api": "1",
              "io.balena.features.sysfs": "1"
            },
            "imageId": 4937832,
            "serviceName": "USB-IP",
            "image": "registry2.balena-cloud.com/v2/b4b429862f9f032b1085250705101fe2@sha256:6db457e3bbe43a039dafb913849d3a5ea31e5dbf000b64b2b721689ba1f72682",
            "running": true
          }
        },
        "networks": {},
        "volumes": {}
      }
    }
  },
  "dependent": {
    "apps": {},
    "devices": {}
  }
}