Knowledge Base add fails silently with an empty 200 when allow_url_fopen=0
@HardeepAsrani is already working on this.
Since Aug 31, 2026.
- Dominant language
- PHP
- Stars
- 1
- Forks
- 1
- Avg merge
- 6h 8m
- Merged PRs (30d)
- 5
Description
Environment: Hyve Lite 2.0.1 - WordPress 7.1 - PHP 8.4.24 - LiteSpeed - shared cPanel host with allow_url_fopen=0
What happens
Clicking Add on any post in Knowledge Base -> WordPress does nothing. POST /wp-json/hyve/v1/data returns HTTP 200 with Content-Length: 0 in ~200 ms. The admin JS gets an unparseable empty body and surfaces a generic error with no indication of the cause. Nothing in the UI explains it, and the plugin otherwise looks healthy: the header shows "API connected" and the chat works, returning real OpenAI responses.
Root cause
Tokenizer::tokenize() builds an EncoderProvider whose DefaultVocabLoader fetches the BPE vocabulary with a raw fopen() on https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken.
With allow_url_fopen=0 that returns false and the loader throws RuntimeException: Could not open stream for URI (DefaultVocabLoader.php:65-68). The call at DB_Table.php:691 is not wrapped, so the exception is uncaught and the request dies before add_data() can return anything.
From the server PHP error log:
PHP Warning: fopen(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in .../plugins/hyve-lite/vendor/guttedgarden/tiktoken/src/Vocab/Loader/DefaultVocabLoader.php on line 65
PHP Warning: fopen(https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken): Failed to open stream: no suitable wrapper could be found in .../DefaultVocabLoader.php on line 65
Three separate problems
- Hard dependency on
allow_url_fopen. Every other outbound call in the plugin goes through the WP HTTP API, so a host that permits cURL but disables URL-fopen breaks only this path, which is why the chat works while ingestion does not. The vocab fetch should usewp_remote_get()and write the cache file itself, or the ~1.7 MBcl100k_base.tiktokenshould ship with the plugin. - No error handling around the tokenizer.
Tokenizer::tokenize()should be wrapped so a vocab failure becomes aWP_Errorthatadd_data()can surface, instead of a fatal that produces an empty 200 the frontend cannot interpret. - Leaked processing flag.
add_post()sets_hyve_post_processingbefore ingesting and deletes it after. When the request dies in between, the flag survives and the post shows "Hyve is processing the post" in the Posts row actions forPROCESSING_STALL(300 s), which misleads the user into thinking something is still running.
Steps to reproduce
- On a host with
allow_url_fopen=0, install Hyve Lite and connect an OpenAI API key. - Knowledge Base -> WordPress -> click Add on any post.
- Network tab:
POST /wp-json/hyve/v1/datareturns 200 with a zero-length body. The PHP error log shows the twofopen()warnings above.
Suggested fix
Replace the fopen-based vocab fetch with wp_remote_get() plus a local write, and wrap the tokenizer call so failures reach the user as a readable message rather than an empty response.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.