Farmbot-Web-App in 2022

Hi, I did my best to build the server. The project state is better than mqtt-gateway but not much.
Does someone run this sw locally (I expect farmbot team has no time to support it).

Shortly: All seems ok, but some path is wrong:
App 173 output: ActionController::RoutingError (No route matches [GET] “/assets/parcel/css/laptop_splash.css”):

OK, the build passed (I followed
Farmbot-Web-App/ubuntu_example.sh at main · FarmBot/Farmbot-Web-App · GitHub). I did wait for “Build server” message and even “tests in the test RAILS_ENV” and “user-interface unit tests” passed with exception - stucked in show results (probably does not except cli and hangs on some gui feature), but all tests passed. So far I see no problem.

But http://localhost:3000 says starting on gray background and nothing happens.

  • my log/passenger.3000.log says :
    [ N 2022-09-05 15:11:47.2602 63/T1 age/Wat/WatchdogMain.cpp:1373 ]: Starting Passenger watchdog…
    [ N 2022-09-05 15:11:47.5743 66/T1 age/Cor/CoreMain.cpp:1340 ]: Starting Passenger core…
    [ N 2022-09-05 15:11:47.5749 66/T1 age/Cor/CoreMain.cpp:256 ]: Passenger core running in multi-application mode.
    [ N 2022-09-05 15:11:47.7174 66/T1 age/Cor/CoreMain.cpp:1015 ]: Passenger core online, PID 66
    [ N 2022-09-05 15:11:50.0329 66/T5 age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 $
    App 105 output: [DEPRECATION] Rack::Attack.throttled_response is deprecated. Please use Rack::Attack.throttled_responder instead
    App 105 output: Not using Google Cloud
    App 105 output: Not using Google Cloud
    App 151 output: method=HEAD path=/ format=html controller=DashboardController action=front_page status=200 duration=111.12 view=29.$
    [ N 2022-09-05 15:17:18.8604 66/T4 age/Cor/CoreMain.cpp:1146 ]: Checking whether to disconnect long-running connections for process$
    App 173 output: method=GET path=/ format=html controller=DashboardController action=front_page status=200 duration=147.54 view=19.2$
    App 173 output:
    App 173 output: ActionController::RoutingError (No route matches [GET] “/assets/parcel/css/laptop_splash.css”):
    App 173 output:
    App 173 output:
    App 173 output: ActionController::RoutingError (No route matches [GET] “/assets/parcel/css/_index.css”):
    App 173 output:
    App 173 output:
    App 173 output: ActionController::RoutingError (No route matches [GET] “/assets/parcel/front_page/index.js”):
    App 173 output:
    App 173 output:
    App 173 output: ActionController::RoutingError (No route matches [GET] “/assets/parcel/front_page/index.js”):
    App 173 output:
    App 328 output: [DEPRECATION] Rack::Attack.throttled_response is deprecated. Please use Rack::Attack.throttled_responder instead
    App 328 output: Not using Google Cloud
    App 328 output: Not using Google Cloud
    App 173 output: method=GET path=/ format=html controller=DashboardController action=front_page status=200 duration=17.66 view=2.63 $
    App 173 output:
    App 173 output: ActionController::RoutingError (No route matches [GET] “/assets/parcel/css/laptop_splash.css”):
    App 173 output:
    App 173 output:
    App 173 output: ActionController::RoutingError (No route matches [GET] “/assets/parcel/front_page/index.js”):

So I except some path is wrong (/assets/parcel/front_page/index.js) . Does someone have idea what could be wrong?

Jan

Hi, I assume this step should make the missing content. Unfortunately it is still missing.

honza@honza-VirtualBox:~/Farmbot-Web-App$ sudo docker compose run web rake assets:precompile
[sudo] password for honza:
[+] Running 2/0
⠿ Container farmbot-web-app-db-1 Running 0.0s
⠿ Container farmbot-web-app-redis-1 Created 0.0s
[+] Running 1/1
⠿ Container farmbot-web-app-redis-1 Started 1.5s
[DEPRECATION] Rack::Attack.throttled_response is deprecated. Please use Rack::Attack.throttled_responder instead
mkdir -p public/assets/
cp -r node_modules/monaco-editor/min/vs public/assets/monaco
rm -rf public/assets/monaco/language
mkdir public/assets/monaco/basic-languages
cp -r node_modules/monaco-editor/min/vs/basic-languages/lua public/assets/monaco/basic-languages/lua
NODE_ENV=production node_modules/.bin/parcel build frontend/css/_index.scss frontend/css/laptop_splash.scss frontend/css/xterm.css frontend/demo/index.tsx frontend/entry.tsx frontend/featured/index.tsx frontend/front_page/index.tsx frontend/os_download/index.tsx frontend/password_reset/index.tsx frontend/terminal/index.tsx frontend/tos_update/index.tsx frontend/try_farmbot/index.tsx --dist-dir public/assets/parcel --public-url /assets/parcel --no-scope-hoist
:sparkles: Built in 438.25s

public/assets/parcel/css/_index.css                         523.35 KB      5.08s
public/assets/parcel/blueprint-icons-16.cd073501.ttf        105.41 KB      1.16s
public/assets/parcel/blueprint-icons-16.7957d031.eot        105.61 KB      3.20s
public/assets/parcel/blueprint-icons-16.6228421b.woff2       37.07 KB      1.16s
public/assets/parcel/blueprint-icons-16.7a60c837.woff        47.63 KB      3.20s
public/assets/parcel/blueprint-icons-20.f19f1852.ttf        108.06 KB      1.17s
public/assets/parcel/blueprint-icons-20.d00b48ba.eot        108.27 KB      3.20s
public/assets/parcel/blueprint-icons-20.2aa7c8dd.woff2       38.07 KB      1.16s
public/assets/parcel/blueprint-icons-20.30b3ae9e.woff        49.12 KB      3.20s
public/assets/parcel/css/laptop_splash.css                     1.7 KB      1.30s
public/assets/parcel/css/xterm.css                            1.31 KB      5.07s
public/assets/parcel/demo/index.js                           682.8 KB     90.27s
public/assets/parcel/entry.js                             ⚠️  3.57 MB    304.98s
public/assets/parcel/404.e30dc73e.js                           1.7 KB     90.25s
public/assets/parcel/controls_page.11f21def.js                2.35 KB    304.96s
public/assets/parcel/messages_page.7b497ad1.js                2.35 KB     90.25s
public/assets/parcel/logs.74b2f86f.js                           13 KB    304.96s
public/assets/parcel/sequences.d33aae57.js                    6.64 KB     90.25s
public/assets/parcel/sequences.d0ab3de1.js                    16.9 KB    304.96s
public/assets/parcel/farm_events.e7853647.js                  6.41 KB     90.27s
public/assets/parcel/farm_events.f801ca5e.js                  2.26 KB    304.96s
public/assets/parcel/add_farm_event.7aeb730b.js               5.44 KB     90.27s
public/assets/parcel/edit_farm_event.ed12080f.js              3.36 KB    304.96s
public/assets/parcel/point_inventory.bed4bfe5.js             10.35 KB     90.27s
public/assets/parcel/point_inventory.a7582057.js              2.98 KB    304.96s
public/assets/parcel/create_points.69ade0a7.js               10.63 KB     90.27s
public/assets/parcel/create_points.d252aebf.js               11.69 KB    304.96s
public/assets/parcel/create_points.24dc0ae7.js                6.47 KB     90.27s
public/assets/parcel/point_info.faf653c4.js                   5.96 KB    304.96s
public/assets/parcel/point_info.4991592e.js                   6.72 KB     90.27s
public/assets/parcel/crop_catalog.900aa931.js                    9 KB    304.96s
public/assets/parcel/add_plant.322c18fe.js                     4.4 KB     90.27s
public/assets/parcel/crop_info.b510bdc8.js                    9.24 KB    304.96s
public/assets/parcel/plant_info.8cd61fef.js                   5.09 KB     90.27s
public/assets/parcel/garden_add.4240bd1c.js                   5.53 KB    304.96s
public/assets/parcel/garden_edit.3c07d723.js                   5.6 KB     90.27s
public/assets/parcel/controls.8980b05c.js                    15.56 KB    304.96s
public/assets/parcel/wizard.e8f738f0.js                      16.01 KB     90.27s
public/assets/parcel/support.0cfcda70.js                       5.7 KB    304.96s
public/assets/parcel/documentation.28c34a5a.js                3.15 KB     90.27s
public/assets/parcel/sensors.fb0c825b.js                     23.13 KB    304.96s
public/assets/parcel/photos.08dc6bc3.js                      34.35 KB     90.27s
public/assets/parcel/photos.20e20f06.js                       5.07 KB    304.96s
public/assets/parcel/list.af1f10df.js                         4.57 KB     90.27s
public/assets/parcel/list.3a721067.js                         1.81 KB    304.96s
public/assets/parcel/add.829545ec.js                          3.65 KB     90.27s
public/assets/parcel/info.59f59683.js                         5.98 KB    304.96s
public/assets/parcel/list.54581a83.js                         6.62 KB     90.27s
public/assets/parcel/preview.c512aa42.js                      4.27 KB    304.96s
public/assets/parcel/list.4a3a1c62.js                         6.12 KB     90.27s
public/assets/parcel/scheduler.34865df1.js                   13.71 KB    304.96s
public/assets/parcel/editor.ccab4f6a.js                       14.6 KB     90.27s
public/assets/parcel/messages.b7adb04c.js                     3.16 KB    304.94s
public/assets/parcel/documentation.1ce23670.js                2.78 KB     90.24s
public/assets/parcel/panel.1fdff3eb.js                        3.68 KB    304.94s
public/assets/parcel/add_tool.676818f9.js                     7.24 KB     90.24s
public/assets/parcel/add_tool_slot.0dca053a.js                4.76 KB    304.94s
public/assets/parcel/edit_tool_slot.4803925a.js                5.4 KB     90.24s
public/assets/parcel/group_list_panel.1c52974e.js             4.08 KB    304.94s
public/assets/parcel/weeds_inventory.1ffa1089.js               9.5 KB     90.24s
public/assets/parcel/weeds_edit.1d23dede.js                   5.62 KB     90.25s
public/assets/parcel/zones_inventory.4403cf7b.js              3.49 KB     90.25s
public/assets/parcel/add_zone.18308620.js                     2.73 KB     90.25s
public/assets/parcel/edit_zone.9c989661.js                    4.06 KB     90.25s
public/assets/parcel/featured/index.js                    ⚠️  2.24 MB     90.41s
public/assets/parcel/front_page/index.js                  ⚠️  2.26 MB    304.95s
public/assets/parcel/os_download/index.js                   427.37 KB    304.94s
public/assets/parcel/password_reset/index.js              ⚠️  2.25 MB    304.95s
public/assets/parcel/terminal/index.js                      701.73 KB    304.94s
public/assets/parcel/terminal/index.css                       1.58 KB      5.66s
public/assets/parcel/tos_update/index.js                  ⚠️  2.27 MB    304.95s
public/assets/parcel/try_farmbot/index.js                   683.87 KB    304.94s

honza@honza-VirtualBox:~/Farmbot-Web-App$ ls public/assets/ -lh
total 12K
-rw-r–r-- 1 root root 65 zář 5 17:09 manifest-0d11a78c5b61e1ac4622eacc53e4a2ac6d111252eecd5db3e70930e1833e5636.js
-rw-r–r-- 1 root root 83 zář 5 17:09 manifest-0d11a78c5b61e1ac4622eacc53e4a2ac6d111252eecd5db3e70930e1833e5636.js.gz
drwxr-xr-x 5 root root 4,0K zář 5 23:24 monaco

Jan

It looks like missing db.
If I disable “RAILS_ENV=production” in the .env file then I see on http:localhost:3000 following error :

ActiveRecord::NoDatabaseError

connection to server at “172.18.0.5”, port 5432 failed: FATAL: database “farmbot_development” does not exist

The port 5432 is defined in .env file under line

MOST USERS SHOULD DELETE THE REST OF THIS FILE.

as
Used by people who pay for managed database hosting.

Most users should delete this.

DATABASE_URL=postgres://user:password@host:5432/db_name

Which I am not, line removed as recommended above. Conclusion, I am not most of users and should setup the database. Maybe pay some money somewhere… as the configuration file recommends…

See me soon

Look here :
Database access from Self host server (linux laptop) - #3

I need probably setup postgres for ruby on rails :

I ran the software locally for a year just to play with it. I’m an systems engineer so that’s part of the fun for me. I ended up moving my bot to the hosted cloud offering though as I got sick of updating it. You’re right though - the local version is largely unsupported by the team at FarmBot as they don’t have the resources to support it along with everything else.

Hi, the db runs now.
No extra installation steps for the postgres was required. The ‘sudo docker compose run web bundle exec rails db:create db:migrate’ did the job. Errors was visible in terminal from command ‘sudo docker compose up’ in the log file (log/passenger.3000.log).

I still see olny gray page in my browser with text: Loading… . I see error messages in ./log/passenger.3000.log :

    App 124 output: method=GET path=/ format=html controller=DashboardController action=front_page status=200 duration=577.58 view=39.34 db=18.63
    App 105 output:
    App 105 output: ActionController::RoutingError (No route matches [GET] "/assets/parcel/css/laptop_splash.css"):
    App 105 output:
    App 124 output:
    App 124 output: ActionController::RoutingError (No route matches [GET] "/assets/parcel/css/_index.css"):
    App 124 output:
    App 150 output:
    App 150 output: ActionController::RoutingError (No route matches [GET] "/assets/parcel/front_page/index.js"):

This seems to me as web content is missing. I see no laptop_splash.css for example in my Farmbot-Web-App folder. The command ‘sudo docker compose run web rake assets:precompile’ does not solve this issue.

The ‘sudo docker compose up’ shows error :

farmbot-web-app-parcel-1       |   GlobalConfig Exists? (2.8ms)  SELECT 1 AS one FROM "global_configs" WHERE "global_configs"."key" = $1 AND "global_configs"."id" != $2 LIMIT $3  [["key", "MQTT_WS"], ["id", 8], ["LIMIT", 1]]
farmbot-web-app-parcel-1       |   TRANSACTION (7.5ms)  COMMIT
farmbot-web-app-parcel-1       | rm -rf .cache public/assets/parcel public/assets/monaco .parcel-cache
farmbot-web-app-parcel-1       | mkdir -p public/assets/
farmbot-web-app-parcel-1       | cp -r node_modules/monaco-editor/min/vs public/assets/monaco
farmbot-web-app-parcel-1       | rm -rf public/assets/monaco/*language*
farmbot-web-app-parcel-1       | mkdir public/assets/monaco/basic-languages
farmbot-web-app-parcel-1       | cp -r node_modules/monaco-editor/min/vs/basic-languages/lua public/assets/monaco/basic-languages/lua
farmbot-web-app-parcel-1       | NODE_ENV=development node_modules/.bin/parcel watch frontend/css/_index.scss frontend/css/laptop_splash.scss frontend/css/xterm.css frontend/demo/index.tsx frontend/entry.tsx frontend/featured/index.tsx frontend/front_page/index
farmbot-web-app-parcel-1       | [Error: inotify_add_watch on '/farmbot/node_modules/http-proxy-agent/dist' failed: No space left on device]
farmbot-web-app-parcel-1       | rake aborted!
farmbot-web-app-parcel-1       | Command failed with status (1): [NODE_ENV=development node_modules/.bin/par...]
farmbot-web-app-parcel-1       | /farmbot/lib/tasks/api.rake:65:in `parcel'
farmbot-web-app-parcel-1       | /farmbot/lib/tasks/api.rake:94:in `block (2 levels) in <top (required)>'
farmbot-web-app-parcel-1       | /bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/cli/exec.rb:58:in `load'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/cli/exec.rb:58:in `kernel_load'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/cli/exec.rb:23:in `run'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/cli.rb:485:in `exec'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/cli.rb:31:in `dispatch'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/cli.rb:25:in `start'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/exe/bundle:48:in `block in <top (required)>'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
farmbot-web-app-parcel-1       | /bundle/gems/bundler-2.3.21/exe/bundle:36:in `<top (required)>'
farmbot-web-app-parcel-1       | /bundle/bin/bundle:113:in `load'
farmbot-web-app-parcel-1       | /bundle/bin/bundle:113:in `<main>'
farmbot-web-app-parcel-1       | Tasks: TOP => api:serve_assets
farmbot-web-app-parcel-1       | (See full trace by running task with --trace)
farmbot-web-app-parcel-1 exited with code 1

But on my host provides enough of disc space:

# df /
/dev/sda1      514935040 14002784 474701576   3% /

Jan

Instructions from ‘node_modules/chokidar/README.md’ solved the space issue.
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Web server is now running.

  farmbot-web-app-mqtt-1         |  * rabbitmq_auth_backend_cache
  farmbot-web-app-mqtt-1         |  * rabbitmq_auth_backend_http
  farmbot-web-app-parcel-1       | Bundling...
  farmbot-web-app-parcel-1       | Packaging & Optimizing...
  farmbot-web-app-parcel-1       | ✨ Built in 143.07s
  farmbot-web-app-typescript-1   | [7:38:55 PM] Found 0 errors. Watching for file changes.

Thank to all for support.
Jan

1 Like

Server is up and running.
I can confirm the local installation works in 2022.

Jan

Final notes :

  • Ubuntu requires just redirect port 80 to port 3000 :
    sudo iptables -A PREROUTING -t nat -i enp0s3 -p tcp --dport 80 -j REDIRECT --to-port 3000

  • Then MQTT is running, farmbot connected, taking even photos with MIPI camera.

  • As I see there is no option to transfer user accout settings from my.farm.bot using export.json .

  • there is no need for additional MQTT broker or postgres setup or installation, all is automatically done by the Farmbot-Web-App project.

This thread can be closed now.
Jan

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.