Giter VIP home page Giter VIP logo

Comments (8)

benfrancis avatar benfrancis commented on August 17, 2024 1

Please see #3043 which looks like the same issue.

from gateway.

ilbertt avatar ilbertt commented on August 17, 2024

same here, but I'm getting the error after running the docker-compose.yml file on my Ubuntu laptop

from gateway.

carlosanunes avatar carlosanunes commented on August 17, 2024

Checked #3043 and rewrote docker-compose.yml according to suggestion:

version: '3.3'
services:
  webthings:
    container_name: webthings
    image: "webthingsio/gateway"
    volumes:
      - ./:/home/node/.webthings
    network_mode: host
    environment:
      - "TZ=Europe/Lisbon"
    restart: always
    ports:
        - 4443:4443
        - 8082:8080
    logging:
      options:
        max-size: "1m"
        max-file: "10"

Still getting error:


    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/node/webthings/gateway/build/models/actions.js:40:34)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
Process 9 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
+ WEBTHINGS_HOME=/home/node/.webthings
+ args=
+ start_task=run-only
+ is_container
+ '[' -f /.dockerenv ']'
+ return 0
++ node --version
++ egrep -o '[0-9]+'
++ head -n1
+ _node_version=12
+ [[ ! -f /home/node/.webthings/.node_version ]]
+ cd /home/node/webthings/gateway
+ mkdir -p /home/node/.webthings/config
+ ./tools/update-addons.sh
Opening database: /home/node/.webthings/config/db.sqlite3
/home/node/webthings/gateway/build/models/things.js:377
addon_manager_1.default.on(Constants.THING_ADDED, (thing) => {
                        ^

TypeError: Cannot read property 'on' of undefined
    at Object.<anonymous> (/home/node/webthings/gateway/build/models/things.js:377:25)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/node/webthings/gateway/build/models/actions.js:40:34)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
Process 10 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
+ WEBTHINGS_HOME=/home/node/.webthings
+ args=
+ start_task=run-only
+ is_container
+ '[' -f /.dockerenv ']'
+ return 0
++ node --version
++ egrep -o '[0-9]+'
++ head -n1
+ _node_version=12
+ [[ ! -f /home/node/.webthings/.node_version ]]
+ cd /home/node/webthings/gateway
+ mkdir -p /home/node/.webthings/config
+ ./tools/update-addons.sh
Opening database: /home/node/.webthings/config/db.sqlite3
/home/node/webthings/gateway/build/models/things.js:377
addon_manager_1.default.on(Constants.THING_ADDED, (thing) => {
                        ^

TypeError: Cannot read property 'on' of undefined
    at Object.<anonymous> (/home/node/webthings/gateway/build/models/things.js:377:25)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/node/webthings/gateway/build/models/actions.js:40:34)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
Process 10 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
+ WEBTHINGS_HOME=/home/node/.webthings
+ args=
+ start_task=run-only
+ is_container
+ '[' -f /.dockerenv ']'
+ return 0
++ egrep -o '[0-9]+'
++ node --version
++ head -n1
+ _node_version=12
+ [[ ! -f /home/node/.webthings/.node_version ]]
+ cd /home/node/webthings/gateway
+ mkdir -p /home/node/.webthings/config
+ ./tools/update-addons.sh
Opening database: /home/node/.webthings/config/db.sqlite3
/home/node/webthings/gateway/build/models/things.js:377
addon_manager_1.default.on(Constants.THING_ADDED, (thing) => {
                        ^

TypeError: Cannot read property 'on' of undefined
    at Object.<anonymous> (/home/node/webthings/gateway/build/models/things.js:377:25)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/node/webthings/gateway/build/models/actions.js:40:34)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

from gateway.

klkr1 avatar klkr1 commented on August 17, 2024

I get the same error on RPi3 Raspbian buster.
Tried configuration as mentioned in [https://github.com//issues/3043].
I was using a deb package with V1.0 before so the docker installation for V1.1 is a fresh one without taking over previous installation.
In the config folder db.sqlite3 with size 0 is created when I try to start the container.

from gateway.

klkr1 avatar klkr1 commented on August 17, 2024

Update: Pulled V1.0.0 and started it, then replaced it with V1.1.0 => V1.1.0 is running
Also copied all files from the deb installation to the config folder => V1.1.0 is running
=> Seems that some files have to be present from previous version initially; fresh installation does not work

from gateway.

carlosanunes avatar carlosanunes commented on August 17, 2024

Just to better understand, your workaround is to install 1.0.0, keep the sqlite database file and then upgrade to 1.1.0 ?

Thanks

from gateway.

carlosanunes avatar carlosanunes commented on August 17, 2024

Followed suggestion in #3066 of creating a .node_version file with '12' in it in the '/home/node/.webthings' folder. And the docker started but throw me a new error:

Emitted 'error' event on WebSocketServer instance at:
at Server.emit (events.js:314:20)
at emitErrorNT (net.js:1343:8)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
�������
port: 8080
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] run-only: node build/app.js
npm ERR! Exit status 1

After this i edited the /config/local.json file to explicitly set HTTP port to 8082 and after this it started.

{
"ports": {
"https": 4448,
"http": 8082
}
}

The docker seems broken in version 1.1.0 but at least there is a workaround. :)

In short, workaround is create a .node_version with the text "12" (no quotes) named file in the '/home/node/.webthings' folder before starting the docker.

from gateway.

klkr1 avatar klkr1 commented on August 17, 2024

Just to better understand, your workaround is to install 1.0.0, keep the sqlite database file and then upgrade to 1.1.0 ?

Thanks

Workaround is to install 1.0.0 and run the container once.
Then remove the container, replace it by 1.1.0, keep all files generated by 1.0.0 (i.e. use the same folder mapping).
If you just take the sqlite file from a working installation that is not enough.

from gateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.