Troubleshooting
Find solutions to common issues you might encounter when using RefineAI, from installation problems to API errors and integration challenges.
Installation Issues
Common issues that may occur during the installation of RefineAI CLI or desktop application:
Permission Denied During Installation
You might encounter permission errors when installing the RefineAI CLI globally.
npm ERR! code EACCES npm ERR! syscall mkdir npm ERR! path /usr/local/lib/node_modules/refine-ai-cli npm ERR! errno -13 npm ERR! Error: EACCES: permission denied
Solution
Use sudo to install the package (on Linux/macOS) or run the command prompt as administrator (on Windows):
sudo npm install -g refine-ai-cli
Alternatively, you can fix npm permissions to allow global installations without sudo:
Learn how to fix npm permissionsNode.js Version Compatibility
RefineAI requires Node.js version 14 or higher. You might see errors if you're using an older version.
Error: RefineAI requires Node.js v14 or higher. Your current version is v12.22.12. Please upgrade your Node.js installation.
Solution
Upgrade your Node.js installation to version 14 or higher:
- • Download and install the latest LTS version from nodejs.org
- • Or use a version manager like nvm (for Linux/macOS) or nvm-windows (for Windows)
nvm install 16 && nvm use 16
Desktop Application Installation Fails
The desktop application installation might fail due to system permissions or antivirus software.
Solutions
- 1.Run the installer as administrator (Windows) or with sudo (Linux).
- 2.Temporarily disable your antivirus software during installation.
- 3.Download the installer directly from the official website instead of using the CLI.
- 4.If you're on macOS, you might need to allow the application in System Preferences → Security & Privacy.
Authentication Issues
Common issues related to API keys and authentication:
Invalid API Key
You might see an "Invalid API Key" error when using the CLI or API.
Error: Invalid API key provided. Please check your API key and try again.
Solutions
- 1.Verify that you're using the correct API key. You can find your API key in the RefineAI dashboard.
- 2.Ensure that you're not including any whitespace or quotes around the API key.
- 3.Generate a new API key if you suspect your current one is compromised or invalid.
- 4.Check that your API key has the necessary permissions for the operation you're trying to perform.
API Key Not Found
The CLI might not be able to find your API key if it's not properly configured.
Error: No API key found. Please set your API key using 'refine config set api-key YOUR_API_KEY' or provide it with the --api-key flag.
Solutions
- 1.Set your API key using the CLI config command:
refine config set api-key YOUR_API_KEY
- 2.Alternatively, you can provide the API key as a command-line argument:
refine analyze --api-key YOUR_API_KEY
- 3.Or set it as an environment variable:
export REFINE_AI_API_KEY=YOUR_API_KEY
Analysis and Optimization Issues
Common issues that may occur during code analysis and optimization:
Analysis Timeout
Analysis might time out for very large repositories or complex codebases.
Error: Analysis timed out after 300 seconds. Please try analyzing a smaller portion of your codebase or contact support for assistance.
Solutions
- 1.Analyze specific directories or files instead of the entire repository:
refine analyze --path src/components
- 2.Use a more specific include/exclude pattern in your configuration file:
# .refineai.yml analysis: include: - "src/components/**/*.js" - "src/utils/**/*.js" exclude: - "**/*.test.js" - "**/*.spec.js" - "node_modules/**" - "dist/**"
- 3.For very large repositories, consider upgrading to a higher tier plan with increased timeout limits.
Optimization Conflicts
Optimization might fail due to conflicts with local changes or other optimizations.
Error: Failed to apply optimization to file src/components/Button.js. Conflict detected: The file has been modified since the analysis was performed.
Solutions
- 1.Commit or stash your local changes before running the optimization:
git commit -am "Save changes before RefineAI optimization"
- 2.Re-run the analysis before optimization to ensure it's based on the current state of your codebase:
refine analyze && refine optimize
- 3.Use the
--force
flag to apply optimizations even if there are conflicts (use with caution):
refine optimize --force
Unsupported Language or Framework
RefineAI might not be able to analyze code in unsupported languages or frameworks.
Warning: Files with extension '.xyz' are not supported and will be skipped. No supported files found in the specified path.
Solutions
- 1.Check the list of supported languages and frameworks in the FAQ.
- 2.Focus on analyzing supported files in your project:
refine analyze --include "**/*.js" --include "**/*.ts"
- 3.Contact support to request support for additional languages or frameworks.
Integration Issues
Common issues with CI/CD, GitHub, and IDE integrations:
GitHub Integration Permission Issues
The GitHub integration might fail due to insufficient permissions.
Error: Failed to create pull request. GitHub API error: Resource not accessible by integration (403)
Solutions
- 1.Check that the RefineAI GitHub App has the necessary permissions for your repository. Go to your repository settings → GitHub Apps and review the permissions.
- 2.If you're using a GitHub token in CI/CD, ensure it has the
repo
scope. - 3.For organization repositories, ensure that the RefineAI GitHub App is installed at the organization level or has access to the specific repository.
CI/CD Pipeline Integration Failures
The CI/CD pipeline integration might fail due to configuration issues.
Error: Failed to run RefineAI in CI/CD pipeline. Could not find configuration file at .refineai.yml
Solutions
- 1.Ensure that the configuration file exists in your repository and is correctly named.
- 2.Check that the CI/CD pipeline has access to the necessary environment variables, especially the API key.
- 3.Verify that the CI/CD configuration is correct and follows the examples in the CI/CD integration documentation.
- 4.If you're using a custom configuration file path, make sure it's correctly specified in the CI/CD configuration.
IDE Plugin Connection Issues
The IDE plugin might fail to connect to the RefineAI API.
Error: Failed to connect to RefineAI API. Please check your internet connection and API key.
Solutions
- 1.Check your internet connection and ensure that your network allows connections to the RefineAI API.
- 2.Verify that your API key is correctly configured in the IDE plugin settings.
- 3.If you're behind a corporate firewall or proxy, configure the IDE plugin to use the proxy settings.
- 4.Try restarting your IDE or reinstalling the plugin if the issue persists.
Still Need Help?
If you're still experiencing issues after trying the solutions above, there are several ways to get additional help:
- •Check the FAQ for answers to common questions.
- •Join our Discord community to get help from other users and the RefineAI team.
- •Contact our support team at support@refine-ai.tech for personalized assistance.
- •For enterprise customers, contact your dedicated account manager for priority support.