Envoy: Envoy unable to be run as normal user after running as a superuser

Created on 17 Aug 2018  路  5Comments  路  Source: envoyproxy/envoy

To reproduce, using envoy 1.7.1,

run envoy as privileged user

sudo ./envoy

run envoy as non-privileged user

./envoy

[2018-08-17 12:05:37.523][12870][critical][assert] external/envoy/source/server/hot_restart_impl.cc:58] panic: cannot open shared memory region /envoy_shared_memory_0 check user permissions
[2018-08-17 12:05:37.523][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:125] Caught Aborted, suspect faulting address 0x3e900003246
[2018-08-17 12:05:37.536][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:94] Backtrace thr<0> obj</lib64/libc.so.6> (If unsymbolized, use tools/stack_decode.py):
[2018-08-17 12:05:37.611][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #0 0x7f9e1805b207 raise
[2018-08-17 12:05:37.611][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #1 0x7f9e1805c8f7 abort
[2018-08-17 12:05:37.611][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:104] thr<0> obj<./envoy_1_7_1_kerb>
[2018-08-17 12:05:38.450][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #2 0x818d05 Envoy::Server::SharedMemory::initialize()
[2018-08-17 12:05:38.455][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #3 0x8193e2 Envoy::Server::HotRestartImpl::HotRestartImpl()
[2018-08-17 12:05:38.459][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #4 0x447697 Envoy::MainCommonBase::MainCommonBase()
[2018-08-17 12:05:38.472][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #5 0x447d9d Envoy::MainCommon::MainCommon()
[2018-08-17 12:05:38.482][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #6 0x4467d3 _ZSt11make_uniqueIN5Envoy10MainCommonEIRiRPPcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_
[2018-08-17 12:05:38.486][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #7 0x4455db main
[2018-08-17 12:05:38.486][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:104] thr<0> obj</lib64/libc.so.6>
[2018-08-17 12:05:38.486][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:114] thr<0> #8 0x7f9e180473d4 __libc_start_main
[2018-08-17 12:05:38.486][12870][critical][backtrace] bazel-out/k8-dbg/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:121] end backtrace thread 0
Aborted (core dumped)

This might be related to https://github.com/envoyproxy/envoy/issues/4060

question stale

Most helpful comment

I had that too! the fix was sudo rm /dev/shm/envoy_shared_memory_0.

I think the main gap for me was the understanding that shared memory region /envoy_shared_memory_0 is actually /dev/shm/envoy_shared_memory_0 in linux.

All 5 comments

This is "expected" and I don't think we will aim to fix this. If you have suggestions on how to increase usability let us know. Perhaps a clean exit with a better error message?

I had that too! the fix was sudo rm /dev/shm/envoy_shared_memory_0.

I think the main gap for me was the understanding that shared memory region /envoy_shared_memory_0 is actually /dev/shm/envoy_shared_memory_0 in linux.

I had the exact same err, sudo rm /dev/shm/envoy_shared_memory_0 solved the problem as described by @yuval-k

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings