Skip to content

Conversation

@redwest88
Copy link
Contributor

@redwest88 redwest88 commented Feb 26, 2024

Overview

This PR addresses a common issue faced by Celestia Bridge node operators, specifically the "too many open files" error:

Error while creating log file in valueLog.open error: while opening file: /opt/celestia/.celestia-bridge/data/003442.vlog error: open /opt/celestia/.celestia-bridge/data/003442.vlog: too many open files

I have proposed an addition to the celestia-node troubleshooting section of the docs. The addition describes steps to increase the LimitNOFILE parameter in the celestia-bridge.service file.

While the celestia-bridge.service file example in the documentation already specifies LimitNOFILE=1400000, it's important to address this in the troubleshooting section, because node operators often set this value to a lower default, such as 65535, which can lead to the above error.

Summary by CodeRabbit

  • Documentation
    • Added troubleshooting instructions for resolving the "too many open files" error in Celestia Bridge nodes.
    • Updated RPC, API, and GRPC endpoints for the Celestia testnet.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2024

Walkthrough

This update provides guidance on resolving the "too many open files" error for Celestia Bridge nodes. It achieves this by detailing the process for adjusting the file descriptor limit within the service file, aiming to ensure the nodes operate smoothly without hitting system limitations.

Changes

File Path Change Summary
nodes/.../celestia-node-troubleshooting.md
nodes/mocha-testnet.md
Added instructions to resolve the "too many open files" error in Celestia Bridge nodes by adjusting the file descriptor limit in the service file.
Updated RPC, API, and GRPC endpoints for the Celestia testnet, replacing old endpoints with new testnet endpoints.

Related issues

  • LimitNOFILE env var in systemd should be higher #1390: This issue highlights the need to increase the LimitNOFILE environment variable in systemd due to BadgerDB's high file descriptor usage. The changes in this PR directly address the underlying problem by providing a method to adjust the file descriptor limit, potentially resolving the concerns raised.

🐇✨

In the realm of bytes and bits,
A node once stumbled, in fits.
"Too many files!" it cried in dismay,
Until a fix came, to brighten its day.
With descriptors aplenty, it hums without fright,
Thanks to the docs, now shining so bright.
🚀🌌

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between be546c9 and 3def82e.
Files selected for processing (1)
  • nodes/celestia-node-troubleshooting.md (1 hunks)

Comment on lines 188 to 227
## Error: "too many open files"
When running a Celestia Bridge node, you may encounter an error in the logs similar to this:
```bash
Error while creating log file in valueLog.open error: while opening file: /opt/celestia/.celestia-bridge/data/003442.vlog error: open /opt/celestia/.celestia-bridge/data/003442.vlog: too many open files
```
This error indicates that the Celestia application is trying to open more files than the operating system's limit allows. To fix this, you will need to edit the Celestia Bridge service file to increase the number of file descriptors that the service can open.
1. Open the service file for editing:
```bash
nano /etc/systemd/system/celestia-bridge.service
```
2. Modify the `LimitNOFILE` parameter:
In the service file, find the `LimitNOFILE` parameter under the [Service] section and set its value to `1400000`. It should look like this:
```ini
[Service]
...
LimitNOFILE=1400000
...
```
:::tip NOTE
Be cautious when increasing file descriptor limits. Setting this value too high might affect system performance. Ensure the value is appropriate for your system's capabilities.
:::
3. Reload daemon and restart Bridge service:
```bash
sudo systemctl daemon-reload
```
```bash
sudo systemctl restart celestia-bridge
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instructions provided for resolving the "too many open files" error are clear and well-structured. However, there are a few areas where improvements can be made for clarity and completeness:

  1. Explicit Mention of File Path: While the instructions to open the service file with nano are clear, it might be helpful for less experienced users to mention that the path /etc/systemd/system/celestia-bridge.service is an example and may vary based on their system configuration or installation method.

  2. Explanation of LimitNOFILE: The instructions do a good job of telling users what to change, but a brief explanation of what LimitNOFILE does and why increasing it helps resolve the "too many open files" error could enhance understanding.

  3. System Performance Warning: The caution about setting the LimitNOFILE value too high is important. It might be beneficial to provide a bit more guidance on how to determine an appropriate value for their system or to suggest consulting with a system administrator if unsure.

  4. Verification Step: After restarting the Celestia Bridge service, adding a step to verify that the change has taken effect could be helpful. This could be as simple as checking the service's status or looking for the absence of the "too many open files" error in the logs.

Overall, these instructions are a valuable addition to the troubleshooting documentation, but incorporating these suggestions could make them even more useful to node operators.

@jcstein
Copy link
Member

jcstein commented Feb 28, 2024

This looks related to #1390 and was resolved in #1407. Can you confirm, @redwest88 ?

@redwest88
Copy link
Contributor Author

Yes, LimitNOFILE=1400000 is already specified in the docs and fixes the error, but I see that some DA operators still face this problem, so it will be helpful to add it in the celestia-node troubleshooting section of the docs, which will potentially help to find and fix this problem faster in the future.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3def82e and 58c1911.
Files selected for processing (1)
  • nodes/mocha-testnet.md (3 hunks)
Additional comments: 3
nodes/mocha-testnet.md (3)
  • 80-80: The update to the RPC endpoint domain names to include "testnet" (celestia-testnet-rpc.f5nodes.com) improves clarity and helps distinguish testnet resources. This change aligns with best practices for naming conventions in development and test environments.
  • 101-101: The update to the API endpoint domain names to include "testnet" (https://celestia-testnet-api.f5nodes.com) is a positive change for similar reasons as the RPC endpoints. It enhances clarity and consistency in the documentation, making it easier for users to understand they are interacting with testnet resources.
  • 123-123: The update to the gRPC endpoint domain names to include "testnet" (celestia-testnet-grpc.f5nodes.com) follows the same rationale as the RPC and API endpoints. This consistency across different types of endpoints is beneficial for users and developers, ensuring a clear distinction between testnet and other environments.

@jcstein jcstein merged commit 009d1a2 into celestiaorg:main Feb 29, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 58c1911 and a73307c.
Files selected for processing (1)
  • nodes/celestia-node-troubleshooting.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • nodes/celestia-node-troubleshooting.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants