0

I have a little question. I already found a solution, but I want to know the reason for the error. So, I have a main config file (nginx.conf) that includes vhost configs.
Example hierarchical tree:

├── nginx.conf
├── sites_enabled
│   ├── sub.mydomain.com
│   └── sub2.mydomain.com

For including vhosts, I use this line:

include /etc/nginx/sites_enabled/*;

I use two different machines with the same OS and Nginx version. On machine A, it works successfully. But on machine B, I get the following error:

nginx: [emerg] pread() returned only 614 bytes instead of 632 in /etc/nginx/sites_enabled/sub.mydomain.com

If I rename my subconfigs to sub_mydomain_com, for example, it works.

I just want to understand the reasons for this error. So, why do I get this error? Why I get error only on one machine?

  • Did you have that config open in your editor? – AlexD Mar 12 '23 at 07:17
  • @AlexD at same time? not. But I use shared config files in glusterfs space. Both machines use these ones – Wusiki Jeronii Mar 12 '23 at 07:20
  • Does this answer your question? [pread() read only xxxx of yyyy](https://serverfault.com/questions/547421/pread-read-only-xxxx-of-yyyy) – AlexD Mar 12 '23 at 07:29
  • @AlexD no. I've already read this question. It's about errors when you've already started nginx and you have problems getting cache files. But I can't start Nginx. And I also tried this solution. Doesn't work – Wusiki Jeronii Mar 12 '23 at 07:45
  • Then you probably have some file metadata caching issue at GlusterFS level. – AlexD Mar 12 '23 at 07:55
  • @AlexD probably. But why it works if I rename files without dots? – Wusiki Jeronii Mar 12 '23 at 07:56
  • The renamed file is a new file so it is not cached. – AlexD Mar 12 '23 at 07:59
  • @AlexD hmm. I didn't think about this theory before. Need to make another test. I'll try to up same config on a third machine. I will you reply later – Wusiki Jeronii Mar 12 '23 at 08:02
  • @AlexD  I launched nginx on the third server. It works as expected. So I returned to the second server (where there is an issue). I renamed a file to its old name. and it didn't work again. I renamed it to the new name, and it worked. I repeated the last step. And I got the error: `mv: 'A' and 'B' are the same file`. It seems you're right. – Wusiki Jeronii Mar 12 '23 at 11:32

0 Answers0