Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trafficserver start failed when TS_ROOT's length > 72 #2421

Closed
kettywj opened this issue Aug 24, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@kettywj
Copy link

commented Aug 24, 2017

compile stage:

./configure --prefix=/trafficserver-7.1.0
make
make install

run stage:

1.copy trafficserver to some path, and "TS_ROOT" (length <= 72) was set as following:

cp -r /trafficserver-7.1.0 /opt/envs/12345678912345678912345678912345678912345/
export TS_ROOT=/opt/envs/12345678912345678912345678912345678912345/trafficserver-7.1.0
cd ${TS_ROOT}
bin/trafficserver start

execute "netstat -anp | grep 8080" succeed, and 8080 was listening.
bin/trafficserver stop
execute "netstat -anp | grep 8080" succeed, and 8080 was closed.

2.And then move trafficserver to another path, and "TS_ROOT" (length = 73) was set as following:

cd /opt/envs
mv 12345678912345678912345678912345678912345 123456789123456789123456789123456789123456
export TS_ROOT=/opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0
cd ${TS_ROOT}
bin/trafficserver start

execute "netstat -anp | grep 8080" failed, and no port was listening. here's the manager.log:

[Aug 24 21:40:29.271] Manager {0x7f7afe77d740} STATUS: opened /opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/var/log/trafficserver/manager.log
[Aug 24 21:40:29.271] Manager {0x7f7afe77d740} NOTE: updated diags config
[Aug 24 21:40:29.272] Manager {0x7f7afe77d740} NOTE: [ClusterCom::ClusterCom] Node running on OS: 'Linux' Release: '4.4.21-69-default'
[Aug 24 21:40:29.272] Manager {0x7f7afe77d740} ERROR: last system error 2: No such file or directory
[Aug 24 21:40:29.272] Manager {0x7f7afe77d740} FATAL: [LocalManager::initMgmtProcessServer] failed to bind socket at /opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/var/trafficserver/processerver.sock
[Aug 24 21:40:29.272] Manager {0x7f7afe77d740} NOTE: [LocalManager::mgmtShutdown] Executing shutdown request.
[Aug 24 21:40:29.272] Manager {0x7f7afe77d740} NOTE: [LocalManager::processShutdown] Executing process shutdown request.
[Aug 24 21:40:29.281] Manager {0x7f89cef7d740} STATUS: opened /opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/var/log/trafficserver/manager.log
[Aug 24 21:40:29.281] Manager {0x7f89cef7d740} NOTE: updated diags config
[Aug 24 21:40:29.282] Manager {0x7f89cef7d740} NOTE: [ClusterCom::ClusterCom] Node running on OS: 'Linux' Release: '4.4.21-69-default'
[Aug 24 21:40:29.282] Manager {0x7f89cef7d740} ERROR: last system error 98: Address already in use
[Aug 24 21:40:29.282] Manager {0x7f89cef7d740} FATAL: [LocalManager::initMgmtProcessServer] failed to bind socket at /opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/var/trafficserver/processerver.sock
[Aug 24 21:40:29.282] Manager {0x7f89cef7d740} NOTE: [LocalManager::mgmtShutdown] Executing shutdown request.
[Aug 24 21:40:29.282] Manager {0x7f89cef7d740} NOTE: [LocalManager::processShutdown] Executing process shutdown request.
[Aug 24 21:40:29.290] Manager {0x7fe7c8095740} STATUS: opened /opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/var/log/trafficserver/manager.log
[Aug 24 21:40:29.290] Manager {0x7fe7c8095740} NOTE: updated diags config
[Aug 24 21:40:29.291] Manager {0x7fe7c8095740} NOTE: [ClusterCom::ClusterCom] Node running on OS: 'Linux' Release: '4.4.21-69-default'
[Aug 24 21:40:29.291] Manager {0x7fe7c8095740} ERROR: last system error 98: Address already in use
[Aug 24 21:40:29.291] Manager {0x7fe7c8095740} FATAL: [LocalManager::initMgmtProcessServer] failed to bind socket at /opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/var/trafficserver/processerver.sock
[Aug 24 21:40:29.291] Manager {0x7fe7c8095740} NOTE: [LocalManager::mgmtShutdown] Executing shutdown request.
[Aug 24 21:40:29.291] Manager {0x7fe7c8095740} NOTE: [LocalManager::processShutdown] Executing process shutdown request.

"processerver.soc" can be found in "/opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/", rather then "processerver.sock"
And when TS_ROOT's length is 74, "processerver.so" can be found
And when TS_ROOT's length is 75, "processerver.s" can be found
...

So appreciate to help to confirm this issue.

@kettywj kettywj changed the title trafficserver start failed when TS_ROOT's length is larger than 72 trafficserver start failed when TS_ROOT's length > 72 Aug 24, 2017

@oknet

This comment has been minimized.

Copy link
Member

commented Aug 24, 2017

The sock file is used to create AF_UNIX socket for local interprocess communication.

In the ProcessManager::initLMConnection(), ATS use struct sockaddr_un to store the sock file path.

           struct sockaddr_un {
               sa_family_t sun_family;               /* AF_UNIX */
               char        sun_path[108];            /* pathname */
           };

The length of /opt/envs/123456789123456789123456789123456789123456/trafficserver-7.1.0/var/trafficserver/processerver.sock is 108 and the k is replaced by \0.

@oknet

This comment has been minimized.

Copy link
Member

commented Aug 24, 2017

@zwoop For the issue, I have 2 advices:

  1. rename the sock file to /tmp/processerver.sock
  2. ink_release_assert(sockpath.length() < sizeof(serv_addr.sun_path))
@kettywj

This comment has been minimized.

Copy link
Author

commented Aug 24, 2017

@oknet , Thank you for the quick response.
Seems I have to relocate the sock file "processserver.sock".
Well, thanks again for your advices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.