Score:0

pread() returned only xxx bytes instead of yyy in config file [SOLVED]

ao flag

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?

jp flag
Did you have that config open in your editor?
Wusiki Jeronii avatar
ao flag
@AlexD at same time? not. But I use shared config files in glusterfs space. Both machines use these ones
jp flag
Does this answer your question? [pread() read only xxxx of yyyy](https://serverfault.com/questions/547421/pread-read-only-xxxx-of-yyyy)
Wusiki Jeronii avatar
ao flag
@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
jp flag
Then you probably have some file metadata caching issue at GlusterFS level.
Wusiki Jeronii avatar
ao flag
@AlexD probably. But why it works if I rename files without dots?
jp flag
The renamed file is a new file so it is not cached.
Wusiki Jeronii avatar
ao flag
@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 avatar
ao flag
@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.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.