Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,149
Community Members
 
Community Events
184
Community Groups

Broken starting clickhouse in a docker because of wrong capabilities request

Hi there,

 

We are installing and starting the clickhouse server in a docker image while pipelining our application.

Till several days ago (the last successful pipeline is May 7th, 2021) it was working fine.

But today the pipeline has broken and the message appears:

/etc/init.d/clickhouse-server: 94: clickhouse: Operation not permitted


We were searching for a problem and found a difference in a building sequence.

In the (old) success pipeline, there was the following log while installing clickhouse:

Setting capabilities for clickhouse binary. This is optional.
command -v setcap >/dev/null && echo > /tmp/test_setcap.sh && chmod a+x /tmp/test_setcap.sh && /tmp/test_setcap.sh && setcap 'cap_net_admin,cap_ipc_lock,cap_sys_nice+ep' /tmp/test_setcap.sh && /tmp/test_setcap.sh && rm /tmp/test_setcap.sh && setcap 'cap_net_admin,cap_ipc_lock,cap_sys_nice+ep' /usr/bin/clickhouse || echo "Cannot set 'net_admin' or 'ipc_lock' or 'sys_nice' capability for clickhouse binary. This is optional. Taskstats accounting will be disabled. To enable taskstats accounting you may add the required capability later manually."
sh: 1: /tmp/test_setcap.sh: Operation not permitted
Cannot set 'net_admin' or 'ipc_lock' or 'sys_nice' capability for clickhouse binary. This is optional. Taskstats accounting will be disabled. To enable taskstats accounting you may add the required capability later manually.

 

The (new) broken pipeline reported on the same place:

Setting capabilities for clickhouse binary. This is optional.
command -v setcap >/dev/null && echo > /tmp/test_setcap.sh && chmod a+x /tmp/test_setcap.sh && /tmp/test_setcap.sh && setcap 'cap_net_admin,cap_ipc_lock,cap_sys_nice+ep' /tmp/test_setcap.sh && /tmp/test_setcap.sh && rm /tmp/test_setcap.sh && setcap 'cap_net_admin,cap_ipc_lock,cap_sys_nice+ep' /usr/bin/clickhouse || echo "Cannot set 'net_admin' or 'ipc_lock' or 'sys_nice' capability for clickhouse binary. This is optional. Taskstats accounting will be disabled. To enable taskstats accounting you may add the required capability later manually."

 

So the sequence is the following:

The installation script creates a test batch, sets up capabilities, and tries to start the script. If the test script starts fine, it sets up capabilities for the clickhouse binary. Else the caps are not set, and the clickhouse is running in user mode.

But in the last broken pipeline, this sequence has broken.
Though the capabilities are still forbidden, the test script has started successfully, and the clickhouse binary has got these caps. But when the clickhouse binary itself has tried to start, it was forbidden because these caps are forbidden.

The found workaround is to add the following code immediately after the clickhouse installation in the Dockerfile:


RUN setcap -r `which clickhouse` && echo "Cleaning caps success" || echo "Cleaning caps error"

What do you think about it?

 

2 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events