I'm running the app with ng serve -o. If I edit styles.scss and hit save then the app live reloads, but editing components (TS or HTML) does not trigger a reload.
No errors show up in in the developer console or in the CLI.
Thoughts?
It happens because of limit of inotify watches and extra files will not be observed, you should increas amount of it.
For Debian, RedHat, or another similar Linux distribution, run:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
For ArchLinux, run:
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
Related
Possible Solution
Possible create files with different permissions.
Steps to Reproduce (for bugs)
Pull image for K8s from varnish docker registry
FROM varnish:6.0
Start it with the docker -compose.
Your Environment:
Version used: Varnish 6.0
Operating System and version: Ubuntu or mac os
Source of binary packages used (if any)
Built from varnish image 6.0
I faced an issue when i use varnishlog.
varnishhist & varnishlog don't work
Here the code Source of DockerFile
I fix the root privilege . Now i need to fix the varnishlog issue.
you can use any default.vcl for demo. https://github.com/varnishcache/varnish-cache/blob/master/bin/varnishd/builtin.vcl
#Varnish stage
FROM varnish:6.0
RUN apt-get update && apt-get install -y libpcap-dev libcap2-bin
COPY docker/varnish/conf/default.vcl /etc/varnish/default.vcl
RUN setcap 'cap_net_bind_service=+ep' /usr/sbin/varnishd
RUN usermod -a -G varnish varnishlog
RUN chown -R varnish:varnish /var/lib/varnish
USER varnish
CMD ["bash", "-c", "varnishd -F -f /etc/varnish/default.vcl -n /tmp/varnish -p http_req_hdr_len=65536 -p http_req_size=98304 -p workspace_backend=256k -p workspace_client=256k -p shm_reclen=1024 -p max_retries=1 & varnishncsa -n /tmp/varnish -b -c -t off"]
`
i'm still suck with my issue VSM: Could not get hold of varnishd, is it running?
It looks like varnishlog is not pointing to the correct directory, or has not access to it.
Any helps would be nice
my varnish works and it is responsive but i can not do an varnishlog.same thing with varnishncsa
Did i make something wrong in my config ?
Because you gave your Varnish instance a name via the -n parameter, you now need to use that same name when calling varnishlog, varnishncsa, varnishtop or varnishstat.
In this case this would be the varnishlog command:
varnishlog -n /tmp/varnish
The -n parameter is only useful when you run multiple Varnish instances on a single machine. I would advise you to drop -n as a varnishd runtime parameter.
Need to increase watchers in docker image, as it fails on expo publish with the error
[11:39:08] Error: ENOSPC: System limit for number of file watchers reached, watch '/__w/mevris-client-app-products/mevris-client-app-products/node_modules/update-notifier/node_modules/camelcase'
[11:39:08] at FSWatcher.start (internal/fs/watchers.js:165:26)
[11:39:08] at Object.watch (fs.js:1258:11)
[11:39:08] at NodeWatcher.watchdir (/__w/mevris-client-app-products/mevris-client-app-products/node_modules/metro/node_modules/sane/src/node_watcher.js:159:22)
[11:39:08] at Walker.<anonymous> (/__w/mevris-client-app-products/mevris-client-app-products/node_modules/metro/node_modules/sane/src/common.js:109:31)
[11:39:08] at Walker.emit (events.js:198:13)
[11:39:08] at /__w/mevris-client-app-products/mevris-client-app-products/node_modules/walker/lib/walker.js:69:16
[11:39:08] at go$readdir$cb (/__w/mevris-client-app-products/mevris-client-app-products/node_modules/#react-native-community/cli/node_modules/graceful-fs/graceful-fs.js:187:14)
[11:39:08] at FSReqWrap.args [as oncomplete] (fs.js:140:20)
Added following lines to Dockerfile
RUN echo "fs.inotify.max_user_instances=524288" >> /etc/sysctl.conf && sysctl -p
results in this error when build
sysctl: setting key "fs.inotify.max_user_watches": Read-only file system
I need to use that docker image in Github Actions
Dockerfile
FROM node:10
RUN echo "fs.inotify.max_user_instances=524288" >> /etc/sysctl.conf
RUN echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf
RUN echo "fs.inotify.max_queued_events=524288" >> /etc/sysctl.conf
RUN apt-get -qq update && apt-get -qq -y install bzip2
RUN yarn global add #bluebase/cli && bluebase plugins:add #bluebase/cli-expo && bluebase plugins:add #bluebase/cli-web
RUN bluebase plugins
RUN npm i -g expo-cli
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["sh", "/entrypoint.sh"]
I had the same issue running Docker on Mac OSX (not docker-for-mac).
Based on the premise that the sysclt settings are shared with the kernel host,
I fixed the problem doing ssh to the docker-machine (boot2docker) and changing the settings there.
$ docher-machine ssh
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p
From this issues/24 and this issues/628
You need to increase the fs.inotify.max_user_watchesparameter on the
host. For example you can create a configuration file in
/etc/sysctl.d. Example /etc/sysctl.d/crashplan.conf with content:
fs.inotify.max_user_watches = 1048576
You can not change at build time is it will not affect and also it will not allow you during build time.
The workaround is to avoid getting this error, set it during run time in the entrypoint.
FROM node:10.16
# set inotify and start the node application, replace yar with your command
RUN echo "#!/bin/sh \n\
echo "fs.inotify.max_user_watches before update" \n\
cat /etc/sysctl.conf\n\
echo "______________________________________________updating inotify ____________________________________" \n\
echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p \n\
echo "updated value is" \n\
cat /etc/sysctl.conf | grep fs.inotify \n\
exec yarn start:dev \
" >> /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# EXPOSE TARGET PORT
EXPOSE 3001
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
try to echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf
source: whats-wrong-with-my-simple-react-docker-image
PS. Maybe it is a problem of a parent host? Check param on the host befor run docker. This work to me.
I'm learning GraphQL and am using prisma-binding for GraphQL operations. I'm facing this nodemon error while I'm starting my Node.js server and its giving me the path of schema file which is auto generated by a graphql-cli. What is this error all about?
Error:
Internal watch failed: ENOSPC: System limit for number of file watchers reached, watch '/media/rehan-sattar/Development/All projects/GrpahQl/graph-ql-course/graphql-prisma/src/generated
If you are using Linux, your project is hitting your system's file watchers limit
To fix this, on your terminal, try:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
You need to increase the inotify watchers limit for users of your system. You can do this from the command line with:
sudo sysctl -w fs.inotify.max_user_watches=100000
That will persist only until you reboot, though. To make this permanent, add a file named /etc/sysctl.d/10-user-watches.conf with the following contents:
fs.inotify.max_user_watches = 100000
After making the above (or any other) change, you can reload the settings from all sysctl configuration files in /etc with sudo sysctl --system. (On older systems you may need to use sudo sysctl -p instead.)
I sometimes get this issue when working with Visual Studio Code on my Ubuntu machine.
In my case the following workaround helps:
Stop the watcher, close Visual Studio Code, start the watcher, and open Visual Studio Code again.
In order to test the changes, I temporary set the parameter with the value 524288.
sysctl -w fs.inotify.max_user_watches=524288
Then I proceed to validate:
npm run serve
And the problem was solved. In order to make it permanent, you should try to add a line in the file "/etc/sysctl.conf" and then restart the sysctl service:
cat /etc/sysctl.conf | tail -n 2
fs.inotify.max_user_watches=524288
sudo systemctl restart systemd-sysctl.service
I had the same problem. However, mine was coming from Webpack. Thankfully, they had a great solution on their site:
For some systems, watching many files can result in a lot of CPU or memory usage. It is possible to exclude a huge folder like node_modules using a regular expression:
File webpack.config.js
module.exports = {
watchOptions: {
ignored: /node_modules/
}
};
This is a problem of inotify (inode notify) in the Linux kernel, so you can resolve it by using this command:
For a temporary solution until rebooting the pc, use the following command
sudo sysctl -w fs.inotify.max_user_watches=100000
A permanent solution: To make this permanent, add a file named /etc/sysctl.d/10-user-watches.conf with the following contents:
fs.inotify.max_user_watches = 10000
After making the change, reload the settings from all sysctl configuration files in /etc with sudo sysctl -p.
It can be hard to know how much to increase the number of watchers by. So, here's a utility to double the number of watchers:
function get_inode_watcher_count() {
find /proc/*/fd -user "$USER" -lname anon_inode:inotify -printf '%hinfo/%f\n' 2>/dev/null |
xargs cat |
grep -c '^inotify'
}
function set_inode_watchers() {
sudo sysctl -w fs.inotify.max_user_watches="$1"
}
function double_inode_watchers() {
watcher_count="$(get_inode_watcher_count)"
set_inode_watchers "$((watcher_count * 2))"
if test "$1" = "-p" || test "$1" = "--persist"; then
echo "fs.inotify.max_user_watches = $((watcher_count * 2))" > /etc/sysctl.d/10-user-watches.conf
fi
}
# Usage
double_inode_watchers
# to make the change persistent
double_inode_watchers --persist
In my case, while I'm doing the nodemon command on the Linux server, I have my Visual Studio Code open (SSH to the server). So based on Juri Sinitson's answer, I just close Visual Studio Code and run the nodemon command again. And it works.
My nodemon command:
nodemon server.js via npm start
I think most answers given here are correct, but using the systemctl command to restart my service solved the problem for me. Check the command below:
sudo systemctl restart systemd-sysctl.service
You should follow answers such as this one:
cjs'
Or:
Isac Moura's
And for latest Ubuntu versions, run sudo sysctl --system to read these settings anew.
However, in my case, my changes to these configuration files were not picked up, because I had already tweaked these settings a while ago... and forgot about it. And I had placed the conflicting configuration file in the wrong place.
According to man sysctl.d, these settings can be placed in /etc/sysctl.d/*.conf, /run/sysctl.d/*.conf and /usr/lib/sysctl.d/*.conf.
In my case I had two files:
/etc/sysctl.d/10-user-watches.conf
/usr/lib/sysctl.d/30-tracker.conf <<< Older file, with lower limit
Due to the naming convention, my older file was read last, and took precedence.
On Linux, I've actually run with sudo.
sudo npm start
After following this tutroial I get the following error when trying to run the commands as user or even sudo:
sudo: no tty present and no askpass program specified
The comments from Lurdan in this article state that you need to run
sudo -S <YOUR_COMMAND>
chmod 0666 /dev/tty
chmod doesn't work but sudo -S does, but surely there's another fix?
So silly, after looking further down I see a solution from Beorat:
To avoid the sudo tty issue and others, run these commands just before running do-release-upgrade:
sudo -S apt-mark hold sudo
sudo -S apt-mark hold procps
sudo -S apt-mark hold strace
If you've already upgraded, run the above commands, then manually downgrade to the Trusty packages:
sudo -S wget http://mirrors.kernel.org/ubuntu/pool/main/s/sudo/sudo_1.8.9p5-1ubuntu1.1_amd64.deb
sudo -S wget http://mirrors.kernel.org/ubuntu/pool/main/p/procps/procps_3.3.9-1ubuntu2_amd64.deb
sudo -S wget http://mirrors.kernel.org/ubuntu/pool/main/s/strace/strace_4.8-1ubuntu5_amd64.deb
sudo -S dpkg -i sudo_1.8.9p5-1ubuntu1.1_amd64.deb
sudo -S dpkg -i procps_3.3.9-1ubuntu2_amd64.deb
sudo -S dpkg -i strace_4.8-1ubuntu5_amd64.deb
More info here: https://github.com/Microsoft/BashOnWindows/issues/482
WSL uses the lxrun executable for management from Windows:
lxrun -h
Usage:
/install - Installs the subsystem
Optional arguments:
/y - Do not prompt user to accept
/uninstall - Uninstalls the subsystem
Optional arguments:
/full - Perform a full uninstall
/y - Do not prompt user to accept
/setdefaultuser - Configures the subsystem user that bash will be launched as. If the user does not exist it will be created.
Optional arguments:
username - Supply the username
/y - If username is supplied, do not prompt to create a password
/update - Updates the subsystem's package index
Given that, you can use lxrun /setdefaultuser root. Just thought I'd point out this side of it since it was required when I ran into the same issue as you after trying to upgrade to Xenial. I can confirm that running this command, then the wget / dpkg commands my issues were resolved.
The commands I used:
wget http://mirrors.kernel.org/ubuntu/pool/main/s/sudo/sudo_1.8.9p5-1ubuntu1.4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/p/procps/procps_3.3.9-1ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/s/strace/strace_4.8-1ubuntu5_amd64.deb
dpkg -i sudo_1.8.9p5-1ubuntu1.4_amd64.deb
dpkg -i procps_3.3.9-1ubuntu2_amd64.deb
dpkg -i strace_4.8-1ubuntu5_amd64.deb
Finally, you might need to run sudo apt-get install -f in case you get The following packages have unmet dependencies [xxx] but it is not going to be installed
I got rid of the error by moving /etc/hosts to /etc/hosts.bu. After closing the shell en opening again, /etc/hosts is recreated and your computer name is added. The error is gone (for me.)
Is there any simple and lightweight monitoring tool like well-known htop, but with web interface? For Debian / Repberry Pi. All solutions I've seen was complicated and resource-intensive.
I've found an interesting solution to run htop (and any other interactive console application) in browser — shellinabox
Install shellinabox
[sudo] apt-get install shellinabox
Stop shellinabox daemon
[sudo] service shellinaboxd stop
Disable shellinaboxd autostart (in default configuration shellinaboxd serves http-ssh session on 4200 port)
[sudo] update-rc.d -f shellinaboxd remove
Now start shellinaboxd with own parameters
[sudo] shellinaboxd -t -b -p 8888 --no-beep \
-s '/htop_app/:nobody:nogroup:/:htop -d 10'
Options:
-t — disable ssl (if necessary, not recommended for public servers)
-b — run in background
-p — web server port number
--no-beep — disable annoying beeps
-s '…commands…' — session configurstion, where
/htop_app/ — URL
nobody:nogroup — user and group for session (nobody:no group chosen for security reasons)
htop -d 10 — command (actually session shell): run htop with -d 10 argument (means update every second)
Now go to browser and navigate to
http://you_server_address:8888/htop_app/
Should look something like this (screenshot)
glances is great! Use that!
https://nicolargo.github.io/glances/
https://iotrant.com/2019/09/03/keep-tabs-on-your-raspberry-pi-with-glances/
Very light dependencies -- basically just Python, psustil, bottle if you want to see it as a webservice...
Thanks everything works well!
In debian wheezy:
[sudo] service shellinaboxd stop
Becomes (without the letter 'd')
[sudo] service shellinabox stop
The same applies to update-rc.d line
[sudo] update-rc.d -f shellinabox remove