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

Bug: clightning docker images fails because of cert generation error #754

Open
limpbrains opened this issue Aug 4, 2023 · 2 comments · May be fixed by #879
Open

Bug: clightning docker images fails because of cert generation error #754

limpbrains opened this issue Aug 4, 2023 · 2 comments · May be fixed by #879
Labels
bug Something isn't working wip Work has started on this

Comments

@limpbrains
Copy link

Describe the bug
When start clightning image with Polar or without, it fails with an error:

2023-08-04T11:50:04.034Z UNUSUAL plugin-plugin.js: --- Starting the cl-rest server ---
Generating a RSA private key
.....+++++
.......+++++
writing new private key to './certs/key.tmp.pem'
req: Can't open "./certs/key.tmp.pem" for writing, Permission denied
2023-08-04T11:50:04.052Z **BROKEN** plugin-plugin.js: {\"status\":1,\"signal\":null,\"output\":[null,\"\",\"Generating a RSA private key\\n.....+++++\\n.......+++++\\nwriting new private key to './certs/key.tmp.pem'\\nreq: Can't open \\\"./certs/key.tmp.pem\\\" for writing, Permission denied\\n\"],\"pid\":79,\"stdout\":\"\",\"stderr\":\"Generating a RSA private key\\n.....+++++\\n.......+++++\\nwriting new private key to './certs/key.tmp.pem'\\nreq: Can't open \\\"./certs/key.tmp.pem\\\" for writing, Permission denied\\n\"}
(node:48) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open './certs/key.pem'
    at Object.openSync (fs.js:498:3)
    at Object.readFileSync (fs.js:394:35)
    at Object.<anonymous> (/opt/c-lightning-rest/cl-rest.js:79:13)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Plugin.restPlugin.onInit (/opt/c-lightning-rest/plugin.js:32:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:48) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:48) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

To Reproduce
Steps to reproduce the behavior:

  1. Create polar network with clightning node
  2. Run it
  3. Look at clightning logs docker logs --follow clightning

Desktop (please complete the following information):

  • OS: MacOS Ventura 13.3.1 (a) (22E772610a)
  • Polar Version: 2.0.0
  • Docker desktop: 4.21.1
  • Docker Version: 24.0.2
  • Docker Compose Version: v2.19.1
@limpbrains limpbrains added the bug Something isn't working label Aug 4, 2023
@jamaljsr
Copy link
Owner

jamaljsr commented Aug 4, 2023

This looks like an issue with file system permissions.

  • Is this with the latest Core Lightning v23.05.2?
  • Are you using Polar's docker image or a custom image?

I've seen Docker exhibit some weird behavior from time to time. You can try restarting or even reinstalling it.

@limpbrains
Copy link
Author

Is this with the latest Core Lightning v23.05.2?

yes

Are you using Polar's docker image or a custom image?

Polar's docker image

This looks like an issue with file system permissions.

Yes, it is.
When I mounted /opt/c-lightning-rest/certs/ and chmod it to 777, service was able to create certificates and start.

You can try restarting or even reinstalling.

Restarting / reinstalling doesn't help

@jamaljsr jamaljsr added the wip Work has started on this label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wip Work has started on this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants