-
Notifications
You must be signed in to change notification settings - Fork 1
[troubleshooting] troubleshooting the service
Ingi Erli edited this page Apr 15, 2020
·
24 revisions
2020-04-14: Machine OS = Ubuntu 18.04.4 LTS (Codename = bionic)
- /home/ingierli/repo/swedishbirdrecoveries/docker-compose
Running make ps
should give the following
docker-compose -f docker-compose.prod.yml ps
Name Command State Ports
-------------------------------------------------------------------------------------------------
jwilder-proxy /app/docker-entrypoint.sh ... Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
shiny /usr/bin/shiny-server.sh Up 3838/tcp
That says that both services have the 'State' 'Up'
make logs
make logs proxy
runs ./refresh-swedishbirdrecoveries.sh >> ./refresh-swedishbirdrecoveries.log 2>&1
refresh-swedishbirdrecoveries.sh
#!/bin/bash
docker exec shiny \
Rscript /usr/local/lib/R/site-library/swedishbirdrecoveries/exec/update_data.R
docker restart shiny
The root-user runs the following script at 04:00 (se su crontab -l
)
- /home/ingierli/repo/swedishbirdrecoveries/docker-compose/bin/refresh-swedishbirdrecoveries.sh
- creates the log : refresh-swedishbirdrecoveries.log
So a 'smell' is: if you cannot find a log refresh-swedishbirdrecoveries.log
with a datestamp from today, then the script did not run for some reason ....
Check the datastamp on the file /tmp/recoveries.csv
$ docker exec -it shiny bash
root@3c82e89e4ebf:/# ls -ali /tmp
total 76864
1211160 drwxrwxrwt 1 root root 4096 Apr 15 07:44 .
1211267 drwxr-xr-x 1 root root 4096 Apr 7 15:55 ..
1593422 -rw-r--r-- 1 root root 78682933 Apr 15 02:00 recoveries.csv
1593423 drwx------ 2 shiny shiny 4096 Apr 15 07:44 RtmpcbUkh5
1593429 drwx------ 2 shiny shiny 4096 Apr 14 15:06 Rtmpj6AJ3H
1593511 drwx------ 2 shiny shiny 4096 Apr 14 15:13 RtmpsGVOx0
root@3c82e89e4ebf:/#
To try out the bundled shiny web application examples:
runShinyApp()
Error: The dbplyr package is required to communicate with database backends.
Backtrace:
█
1. └─swedishbirdrecoveries::update_data()
2. └─dplyr::src_sqlite(BIRDS_DB)
3. └─dplyr::check_dbplyr()
4. └─dplyr:::check_pkg(...)
5. └─dplyr:::glubort(...)
Execution halted
shiny
The update_data.R is dependent on the dbplyr-package , which is not installed
- docker exec -it shiny bash
- R
- > install.packages("dbplyr")
- q();
- Rscript /usr/local/lib/R/site-library/swedishbirdrecoveries/exec/update_data.R
- exit (exit the container)
- docker restart shiny
after running step 5, should give this log
Last update was2017-11-13
Update needed, getting remote data...
Downloading updated dataset from http://fagel3.nrm.se/fagel/aterfynd/SQLDataExport.csv into /tmp/recoveries.csv
trying URL 'http://fagel3.nrm.se/fagel/aterfynd/SQLDataExport.csv'
Content type 'text/csv' length 78682933 bytes (75.0 MB)
==================================================
downloaded 75.0 MB
Warning: 2 parsing failures.
row col expected actual file
17461 FKD an integer REL- '/tmp/recoveries.csv'
17462 FKD an integer REL- '/tmp/recoveries.csv'
Parsed with column specification:
cols(
colname = col_character(),
desc_swe = col_character(),
desc_eng = col_character()
)
Logging update with timestamp
Done updating/usr/local/lib/R/site-library/swedishbirdrecoveries/extdata/sbr.db
Warning message:
Missing values are always removed in SQL.
Use `MAX(x, na.rm = TRUE)` to silence this warning
This warning is displayed only once per session.
ll /var/log
-
less /var/log/syslog
: [Shift]+[g] -> to the end of the log -
tail -f /var/log/syslog
: f for follow
Viewing logs with dmesg
dmesg less
df -h
df -h /boot