Skip to main content
coderpal

2 years ago

Lecture: Preparing a Node.js Sample Application

For some reasons web-client.service start to stop very quickly.  It's a failure somewhere. Message is not very clear: it says that web-client.service holdoff time over, scheduling restart.
start request repeated too quickly for web-client.service
Failed to start S3 Photo App Node.js service.
The two other services start normally: photo-storage.service and photo-filter.service.
I have no idea what I am doing wrong

Image of
2 years ago
Take a look at the full logs from the service using `journalctl --no-pager -u web-client.service | less`. Is there any more useful information in that output?

The first few things I would suggest trying are:

1. Check /var/log/messages for anything including that application path and SELinux. One quick test is to use `setenforce 0` and then restart the service. If it works as expected then you know there's an SELinux problem.
2. Ensure that all of the required environment variables are set properly.
3. Make sure that the command to start the service works if you set the variables and run the command manually using the user indicated in the unit file.

Hopefully, we'll be able to get you up and running shortly. Let me know what you discover.
Image of coderpal
coderpal
2 years ago
Hello Keith,
I thank you for pointing to the right direction. The error was due to a time difference between AWS servers and the clock on my version of Centos 7. I am out of the country for a few days in a totally different time zone.

The log of the web-client service revealed indeed the problem: "ERROR: Unable to create or describe required table in DynamoDB { InvalidSignatureException: Signature not yet current: 20181030T083420Z is still later than 20181030T064920Z (20181030T063420Z + 15 min.)". By simply adjusting the internal clock to PDT with the command ntpdate time.nist.gov, I was able to start successfully the web-client .

But then nginx stopped working . Per the logs, it was a permission error (2018/10/30 03:11:43 [emerg] 1767#1767: open() "/etc/nginx/conf.d/example.com.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:34). I tried to modify SELinux as shown in the lecture: Simple Virtual Host and Serving Static Content, but to no avail. I eventually modified  the file /etc/sysconfig/selinux by changing "enforcing" to "permissive", and everything is now working fine.

The internal clock needs to be adjsuted each time that I reboot Centos. I have then to start manually web-client.

Thank again for your help.

Pierre


Image of
2 years ago
The clock difference definitely wasn't my first guess. I'm glad you were able to get all of the issues sorted out.