ERPNext update problem Error: watch ENOSPC

ERPNext: v12.0.8 (version-12)
Frappe Framework: v12.0.8 (version-12)
Running on: fedora-28

The problems: Update failed for some reason and now bench start fails to start up the application.

Steps:

$ bench update


        Patching sites...
    Migrating site1
    Executing frappe.patches.v12_0.move_email_and_phone_to_child_table in site1 (site1)
    Success: Done in 2.094s
    Executing execute:frappe.reload_doc('desk', 'doctype','dashboard_chart_link') in site1 (site1)
    Success: Done in 0.022s
    Executing execute:frappe.reload_doc('desk', 'doctype','dashboard') in site1 (site1)
    Success: Done in 0.024s
    Executing execute:frappe.reload_doc('desk', 'doctype','dashboard_chart_source') in site1 (site1)
    Success: Done in 0.025s
    Executing execute:frappe.reload_doc('desk', 'doctype','dashboard_chart') in site1 (site1)
    Success: Done in 0.026s
    Executing erpnext.patches.v12_0.add_default_dashboards in site1 (site1)
    Success: Done in 0.483s
    Executing erpnext.patches.v12_0.remove_bank_remittance_custom_fields in site1 (site1)
    Success: Done in 0.046s
    Executing erpnext.patches.v12_0.move_credit_limit_to_customer_credit_limit in site1 (site1)
    Success: Done in 1.599s
    Executing erpnext.patches.v12_0.add_variant_of_in_item_attribute_table in site1 (site1)
    Success: Done in 0.063s
    Updating DocTypes for frappe        : [========================================]
    Updating DocTypes for erpnext       : [========================================]
    Updating customizations for Address
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
        "__main__", fname, loader, pkg_name)
      File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
        exec code in run_globals
      File "/erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
        main()
      File "/erp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
        click.Group(commands=commands)(prog_name='bench')
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 764, in __call__
        return self.main(*args, **kwargs)
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 717, in main
        rv = self.invoke(ctx)
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "/erp/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 25, in _func
        ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      File "/erp/frappe-bench/apps/frappe/frappe/commands/site.py", line 233, in migrate
        migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
      File "/erp/frappe-bench/apps/frappe/frappe/migrate.py", line 62, in migrate
        global_search.update_global_search_for_all_web_pages()
      File "/erp/frappe-bench/apps/frappe/frappe/utils/global_search.py", line 280, in update_global_search_for_all_web_pages
        sync_global_search()
      File "/erp/frappe-bench/apps/frappe/frappe/utils/global_search.py", line 361, in sync_global_search
        while frappe.cache().llen('global_search_queue') > 0:
      File "/erp/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 141, in llen
        return super(RedisWrapper, self).llen(self.make_key(key))
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/redis/client.py", line 1325, in llen
        return self.execute_command('LLEN', name)
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/redis/client.py", line 673, in execute_command
        connection.send_command(*args)
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 610, in send_command
        self.send_packed_command(self.pack_command(*args))
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 585, in send_packed_command
        self.connect()
      File "/erp/frappe-bench/env/lib/python2.7/site-packages/redis/connection.py", line 489, in connect
        raise ConnectionError(self._error_message(e))
    redis.exceptions.ConnectionError: Error 111 connecting to localhost:13000. Connection refused.

$ bench start

produces the following error:

13:53:01 watch.1          | > frappe@ watch /erp/frappe-bench/apps/frappe
13:53:01 watch.1          | > node rollup/watch.js
13:53:01 watch.1          |
13:53:03 web.1            |  * Debugger is active!
13:53:03 web.1            |  * Debugger PIN: 202-501-760
13:53:05 watch.1          |
13:53:05 watch.1          | Rollup Watcher Started
13:53:05 watch.1          |
13:53:05 watch.1          | Watching...
13:53:06 watch.1          | Rebuilding frappe-web-b4.css
13:53:06 watch.1          | events.js:183
13:53:06 watch.1          |       throw er; // Unhandled 'error' event
13:53:06 watch.1          |       ^
13:53:06 watch.1          |
13:53:06 watch.1          | Error: watch /erp/frappe-bench/apps/frappe/frappe/public/less/variables.less ENOSPC
13:53:06 watch.1          |     at _errnoException (util.js:992:11)
13:53:06 watch.1          |     at FSWatcher.start (fs.js:1382:19)
13:53:06 watch.1          |     at Object.fs.watch (fs.js:1408:11)
13:53:06 watch.1          |     at createFsWatchInstance (/erp/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:38:15)
13:53:06 watch.1          |     at setFsWatchListener (/erp/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:81:15)
13:53:06 watch.1          |     at FSWatcher.NodeFsHandler._watchWithNodeFs (/erp/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:233:14)
13:53:06 watch.1          |     at FSWatcher.NodeFsHandler._handleFile (/erp/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:262:21)
13:53:06 watch.1          |     at FSWatcher.<anonymous> (/erp/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:495:21)
13:53:06 watch.1          |     at FSReqWrap.oncomplete (fs.js:153:5)

My issue was solved by the following:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
&& sudo sysctl -p
2 Likes