Open proton1k opened 2 years ago
+1 on this. Getting the same issue. Tried generating the certs manually which got me past that step, but then get stuck with .kong_env
which seems to have some permissions issue. When permissions provided (chmod 777 the both just the file and the entire dir) and kong start
ed, it overwrites said file (or resets permission at least). Tagging @kikito since it seems like you've had the last human commits in this repo.
kong % chmod 777 .kong_env
kong % ls -la .kong_env
-rwxrwxrwx 1 %%user%% admin 0 Jul 22 02:50 .kong_env
kong % kong start --v -c /etc/kong/kong.conf
2022/07/22 02:51:18 [verbose] Kong: 2.8.1
2022/07/22 02:51:18 [verbose] reading config file at /etc/kong/kong.conf
2022/07/22 02:51:18 [verbose] prefix in use: /opt/homebrew/opt/kong
2022/07/22 02:51:18 [verbose] preparing nginx prefix directory at /opt/homebrew/opt/kong
2022/07/22 02:51:18 [verbose] SSL enabled on
2022/07/22 02:51:18 [verbose] proxy SSL certificate found at /opt/homebrew/opt/kong/ssl/kong-default.crt
2022/07/22 02:51:18 [verbose] proxy SSL certificate found at /opt/homebrew/opt/kong/ssl/kong-default-ecdsa.crt
2022/07/22 02:51:18 [verbose] SSL enabled on
2022/07/22 02:51:18 [verbose] admin SSL certificate found at /opt/homebrew/opt/kong/ssl/admin-kong-default.crt
2022/07/22 02:51:18 [verbose] admin SSL certificate found at /opt/homebrew/opt/kong/ssl/admin-kong-default-ecdsa.crt
2022/07/22 02:51:18 [warn] ulimit is currently set to "256". For better performance set it to at least "4096" using "ulimit -n"
Error:
/opt/homebrew/share/lua/5.1/kong/cmd/start.lua:24: unable to open env path /opt/homebrew/opt/kong/.kong_env (/opt/homebrew/opt/kong/.kong_env: Permission denied)
stack traceback:
[C]: in function 'assert'
/opt/homebrew/share/lua/5.1/kong/cmd/start.lua:24: in function 'cmd_exec'
/opt/homebrew/share/lua/5.1/kong/cmd/init.lua:89: in function </opt/homebrew/share/lua/5.1/kong/cmd/init.lua:89>
[C]: in function 'xpcall'
/opt/homebrew/share/lua/5.1/kong/cmd/init.lua:89: in function </opt/homebrew/share/lua/5.1/kong/cmd/init.lua:46>
/opt/homebrew/bin/kong:10: in function 'file_gen'
init_worker_by_lua:49: in function <init_worker_by_lua:47>
[C]: in function 'xpcall'
init_worker_by_lua:56: in function <init_worker_by_lua:54>
kong % ls -la .kong_env
--w------- 1 %%user%% admin 0 Jul 22 02:51 .kong_env
Willing to attach more logs if required
Update to that, modifying some stuff in prefix_handler.lua
helped me get past the issues, once I manually created the certs.
I inserted this at line 293 :
ffi.cdef[[
typedef struct {
char *fpos;
void *base;
unsigned short handle;
short flags;
short unget;
unsigned long alloc;
unsigned short buffincrement;
} FILE;
FILE *fopen(const char *filename, const char *mode);
int fprintf(FILE *stream, const char *format, ...);
int fclose(FILE *stream);
]]
local f = ffi.C.fopen(path, "a+")
ffi.C.fclose(f)
which creates an empty file before the next line tries to open it. It is possible that the same issue is happening with the certs as the lua code tries to write the file, but fails.
For now this seems to work in my case. If anyone is monitoring this issue, can a fix be provided for the certs problem along with this ?
Hi, After installation on Mac M1 (Apple chip) from homebrew, I ran into the following:
I see contradicting lines here:
and the
From the folder where homebrew installs modules:
So, what's wrong with the "proxy SSL certificate found at..." ? I used an official tutorial here: https://docs.konghq.com/gateway/latest/install-and-run/macos/