Error: chown cannot dereference WITH sudo chown root:root COMMAND

Keywords: WordPress + NGINX + SSL - Installers - How to - Secure Connections (SSL/HTTPS)

Description:
Towards the last 2 steps of the Generate And Install A Let’s Encrypt SSL Certificate For A Bitnami Application guide. I have come across an error that I have not been able to solve.

I ran the: sudo chown root:root ./wordpresspro/nginx/conf/server* command and received a: chown: cannot dereference ´./wordpresspro/nginx/server.crt´: No such file or directory
chown: cannot dereference ´./wordpresspro/nginx/server.key´: No such file or directory

Any help would be greatly appreciated.

Hi @avanzate1,

Thanks for your message. That error usually means there was another error in a previous step, probably linking the Let’s Encrypt certificate to the NGINX installation folder. Can you run the bndiagnostic tool and open a new “technical issue” thread here in the forum? Our team is actively monitoring it and will be glad to help you.

https://docs.bitnami.com/general/how-to/understand-bndiagnostic/

Ok, I will run the bndiagnostic tool. In the meantime, could you please view this screenshot and confirm that I did indeed run across a previous error? I seem to feel that all previous steps were performed succesfully.

Hi!

Ok, I will run the bndiagnostic tool. In the meantime, could you please view this screenshot and confirm that I did indeed run across a previous error?

Yes, it seems that the let’s encrypt certificate was not generated correctly. The file that the symlink points to is invalid. It would be nice if you could share a link to this thread in the new Technical Issue ticket.

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

I started with a fresh install on the deployment Instance and decided to install the Diagnostic Tool 1st just in case I couldn´t get past this Guide. It just so happens that I came across the same “chown cannot dereference” issue at the exact point.

So I proceeded with the Diagnostic Tool and the Technical Issue ticket cannot find my upload data. I´ve attached a screenshot showing my progress and issue with the Diagnostic Tool data upload.

Hello @avanzate1,

It seems you are using the path /home/bitnami/... to install letsencrypt and run the commands. Could you please double-check if you encounter the same error using the path /opt/bitnami/...?

Regarding the issue creating the ticket, I was able to access your bndiagnostic report so it could be an issue on our site. We’ll investigate the issue internally. In the meantime, let’s continue the discussion in this thread.

Regards,
Francisco de Paz

Greetings Francisco,

Initially, I followed the guide on how to upgrade a current Wordpress install to a Nginx + SSL (WordpressPro) per How to install wordpress + nginx on AWS lightsail?

Within the guide, the /opt/bitnami/… installation is backed up and saved at /opt/bitnami.bak. There is no Nginx server contained within that directory so I could not run the command because it wouldn´t apply.

Thanks for finding the bndiagnostic report. Look forward to hearing from you.

Cordially,

Marco

I am wondering if Bitnami offers a Paid Support solution? I feel excited about using Amazon Lightsail with Wordpress + Nginx + SSL but it has been over a week or so and I have not been able to resolve a SSL configuration.

Is my situation that difficult in reality? I am just wondering how to proceed because I really wanted to use Lightsail with the Bitnami WordpressPro package.

Hello @avanzate1,

We are sorry to tell you that we do not provide this kind of service. This Community is for giving support on issues discovered with our application packaging. We try to help our users in this forum but we do not offer any kind of paid support.

Having said that, sorry about the wait, this got messed up and I lost the thread. I re-checked your configuration and the error should be coming from using an incorrect name for your .crt filename when creating the symlink. You created the link for server.key and server.crt twice, once linking it to /home/bitnami/letsencrypt/domain.com.crt and another one to /home/bitnami/letsencrypt/www.domain.com.crt, which overwrote the first link:

$ ls -la /home/bitnami/nginx/conf

lrwxrwxrwx 1 root root   79 Sep 11 01:21 server.crt -> /home/bitnami/wordpresspro/letsencrypt/certificates/www.domain.com.crt
lrwxrwxrwx 1 root root   79 Sep 11 01:17 server.key -> /home/bitnami/wordpresspro/letsencrypt/certificates/www.domain.com.key

The issue is that you only have the cert files called domain.com.*:

$ ls -la /home/bitnami/letsencrypt/certificates

total 28
drwx------ 2 root root 4096 Sep 11 00:36 .
drwxr-xr-x 5 root root 4096 Sep 11 00:35 ..
-rw------- 1 root root 5406 Sep 11 00:36 domain.com.crt
-rw------- 1 root root 3751 Sep 11 00:36 domain.com.issuer.crt
-rw------- 1 root root  240 Sep 11 00:36 domain.com.json
-rw------- 1 root root  288 Sep 11 00:36 domain.com.key

You would need to create the link for the domain.com.* once again. To enable SSL in both www.domain.com and domain.com you just need to pass both domains to the letsencrypt command:

sudo /home/bitnami/letsencrypt/lego --tls --email="EMAIL-ADDRESS" --domains="DOMAIN" --domains="www.DOMAIN" --path="/home/bitnami/letsencrypt" run
1 Like

Awesome!!! I guess I was confused with the "Repeat Steps 2 & 3… " within the Guide.

SSL Certificate is working great. All I need to do now is Force HTTPS with Nginx.

Renew Certificate and Cronjob all setup. I appreciate it.

Hello @avanzate1,

I’m glad it worked! I’ll proceed to close this issue as it has now a solution. We’ll continue the discussion on how to force the redirection on the new thread.

Regards,
Francisco de Paz