|
| 1 | +--- |
| 2 | +id: errors |
| 3 | +title: Common Errors in Keploy |
| 4 | +sidebar_label: Common Errors |
| 5 | +tags: |
| 6 | + - explanation |
| 7 | + - faq |
| 8 | +--- |
| 9 | + |
| 10 | +Let's check some of the common errors that you might encounter while working with Keploy! |
| 11 | + |
| 12 | +[](https://camo.githubusercontent.com/74cbc79070c04e7077cfd86981c110678fe434e9269ea8f52eafb37b781cfb4a/68747470733a2f2f646f63732e6b65706c6f792e696f2f696d672f6b65706c6f792d6c6f676f2d6461726b2e7376673f733d32303026763d34) |
| 13 | + |
| 14 | +### 1. Dependency Not Found Error |
| 15 | + |
| 16 | +#### Description: |
| 17 | + |
| 18 | +This error occurs when Keploy cannot locate or access a required dependency, such as a database or external service. |
| 19 | + |
| 20 | +#### Possible Cause: |
| 21 | + |
| 22 | +- The dependency may not be running or is incorrectly configured. |
| 23 | +- Networking issues may be preventing Keploy from connecting to external dependencies. |
| 24 | + |
| 25 | +#### Solution: |
| 26 | + |
| 27 | +- Verify that all required services (e.g., databases, third-party APIs) are active and accessible. |
| 28 | +- Check the environment variables or configuration files to confirm the correct host and port details. |
| 29 | +- Use network diagnostic tools (e.g., ping, traceroute) to identify connectivity issues. |
| 30 | + |
| 31 | +### 2. Unable to Record API Calls |
| 32 | + |
| 33 | +#### Description: |
| 34 | + |
| 35 | +Keploy fails to record incoming API traffic, meaning no tests are generated. |
| 36 | + |
| 37 | +#### Possible Cause: |
| 38 | + |
| 39 | +- Incorrect integration with the application. |
| 40 | +- Keploy may not be correctly started with the application, or the SDK is not configured properly. |
| 41 | +- The application may not be making API calls that are recognizable by Keploy. |
| 42 | + |
| 43 | +#### Solution: |
| 44 | + |
| 45 | +- Double-check the integration guide for the programming language you’re using. |
| 46 | +- Ensure that Keploy is properly hooked into the API layer. |
| 47 | +- Check Keploy logs for any missed or skipped requests. |
| 48 | + |
| 49 | +### 3. Test Replay Failure |
| 50 | + |
| 51 | +#### Description: |
| 52 | + |
| 53 | +Keploy is unable to replay recorded API requests. |
| 54 | + |
| 55 | +#### Possible Cause: |
| 56 | + |
| 57 | +- External services or databases may be in a different state than they were during recording. |
| 58 | +- Non-deterministic values like timestamps, UUIDs, or random values are causing failures. |
| 59 | + |
| 60 | +#### Solution: |
| 61 | + |
| 62 | +- Leverage Keploy’s mocking capabilities to simulate external services and databases. |
| 63 | +- Use configurations to handle or exclude non-deterministic values for consistent comparisons. |
| 64 | +- Regularly reset the database state to match the conditions during recording. |
| 65 | + |
| 66 | +### 4. Response Mismatch Error |
| 67 | + |
| 68 | +#### Description: |
| 69 | + |
| 70 | +When Keploy replays API calls, it detects a mismatch between the recorded response and the current response. |
| 71 | + |
| 72 | +#### Possible Cause: |
| 73 | + |
| 74 | +- The application’s behavior has changed, leading to different responses. |
| 75 | +- Changes in the response format, status codes, or headers that weren’t present during recording. |
| 76 | + |
| 77 | +#### Solution: |
| 78 | + |
| 79 | +- Review the application changes and determine if the mismatch is expected (e.g., new features). |
| 80 | +- If the change is acceptable, update the test baseline to reflect the new behavior. |
| 81 | +- Use Keploy’s flexible comparison options to ignore certain fields or values (like timestamps or version numbers). |
| 82 | + |
| 83 | +### 5. Incorrect Test Generation |
| 84 | + |
| 85 | +#### Description: |
| 86 | + |
| 87 | +Keploy generates tests that don’t properly reflect the API interactions. |
| 88 | + |
| 89 | +#### Possible Cause: |
| 90 | + |
| 91 | +- The API interaction may be too complex or involve custom logic that Keploy cannot automatically handle. |
| 92 | +- API parameters may be missing or misinterpreted during recording. |
| 93 | + |
| 94 | +#### Solution: |
| 95 | + |
| 96 | +- Review the recorded test cases for correctness. |
| 97 | +- Manually adjust the generated tests to include missing or misinterpreted parameters. |
| 98 | +- Make use of Keploy’s API to refine the recording process if necessary. |
| 99 | + |
| 100 | +### 6. Database Connection Error during Test Replay |
| 101 | + |
| 102 | +#### Description: |
| 103 | + |
| 104 | +Keploy cannot connect to the database or other external systems during the replay of tests. |
| 105 | + |
| 106 | +#### Possible Cause: |
| 107 | + |
| 108 | +- The test environment may not have access to the same database as the original recording. |
| 109 | +- Database credentials or host information could be incorrect or missing in the test environment. |
| 110 | + |
| 111 | +#### Solution: |
| 112 | + |
| 113 | +- Mirror the test environment configuration with the recording setup. |
| 114 | +- Use database mocks or stubs for isolated testing. |
| 115 | +- Double-check connection strings, credentials, and database availability. |
| 116 | + |
| 117 | +### 7. Missing or Invalid Configuration Error |
| 118 | + |
| 119 | +#### Description: |
| 120 | + |
| 121 | +Keploy cannot find a valid configuration file or encounters errors in the configuration. |
| 122 | + |
| 123 | +#### Possible Cause: |
| 124 | + |
| 125 | +- The Keploy configuration file (keploy.yaml or similar) is missing or contains invalid values. |
| 126 | +- Environment variables required by Keploy may not be set. |
| 127 | + |
| 128 | +#### Solution: |
| 129 | + |
| 130 | +- Ensure the configuration file exists and follows the correct format. |
| 131 | +- Populate all required fields with valid values. |
| 132 | +- Check that environment variables are properly set. |
| 133 | + |
| 134 | +### 8. Timeout Errors |
| 135 | + |
| 136 | +#### Description: |
| 137 | + |
| 138 | +Keploy times out while recording or replaying API calls. |
| 139 | + |
| 140 | +#### Possible Cause: |
| 141 | + |
| 142 | +- Long-running API requests or slow external dependencies can cause timeout issues. |
| 143 | +- Keploy may have low timeout settings for API calls. |
| 144 | + |
| 145 | +#### Solution: |
| 146 | + |
| 147 | +- Increase timeout settings in the Keploy configuration. |
| 148 | +- Identify and optimize slow-performing APIs or dependencies. |
| 149 | +- Use monitoring tools to analyze API performance. |
| 150 | + |
| 151 | +### 9. Insufficient Permissions |
| 152 | + |
| 153 | +#### Description: |
| 154 | + |
| 155 | +Keploy fails due to insufficient permissions when accessing files, networks, or other resources. |
| 156 | + |
| 157 | +#### Possible Cause: |
| 158 | + |
| 159 | +The user or service running Keploy may not have sufficient permissions to access resources like databases, APIs, or file systems. |
| 160 | + |
| 161 | +#### Solution: |
| 162 | + |
| 163 | +- Ensure that the user or service running Keploy has the necessary permissions. |
| 164 | +- Review system permissions and provide the required access rights for Keploy to function properly. |
| 165 | + |
| 166 | +### 10. Version Compatibility Issues |
| 167 | + |
| 168 | +#### Description: |
| 169 | + |
| 170 | +Errors occur because of version mismatches between Keploy, its dependencies, or the application it’s testing. |
| 171 | + |
| 172 | +#### Possible Cause: |
| 173 | + |
| 174 | +- Using incompatible versions of Keploy or related SDKs with your application. |
| 175 | +- Dependencies of Keploy (e.g., for mocking or replaying) may have updated and broken compatibility. |
| 176 | + |
| 177 | +#### Solution: |
| 178 | + |
| 179 | +- Verify version compatibility for Keploy and its SDKs. |
| 180 | +- Consult Keploy documentation or release notes for known issues. |
| 181 | +- Use version pinning to maintain a stable environment. |
| 182 | + |
| 183 | +### 11. Unsupported Protocol or API |
| 184 | + |
| 185 | +#### Description: |
| 186 | + |
| 187 | +Keploy does not support the protocol or API structure you are using (e.g., gRPC, SOAP, etc.). |
| 188 | + |
| 189 | +#### Possible Cause: |
| 190 | + |
| 191 | +- The application might use an API or protocol that Keploy doesn’t yet support (e.g., WebSocket, gRPC). |
| 192 | + |
| 193 | +#### Solution: |
| 194 | + |
| 195 | +- Confirm the supported protocols (currently HTTP/REST and GraphQL). |
| 196 | +- Consider alternative tools or frameworks for unsupported protocols. |
| 197 | + |
| 198 | +If you’re still encountering issues after trying these solutions, feel free to reach out to the Keploy team or consult the community forums for additional support. Happy testing! |
| 199 | + |
| 200 | +import GetSupport from '../concepts/support.md' |
| 201 | + |
| 202 | +<GetSupport/> |
0 commit comments