Error: "Failed to validate agent ID on a zome" since hdk 0.0.25

I get the following errors since hdk 0.0.25:
It happens at start, and also with the default zome code generated by hc (my_entry)

WARN 2019-09-20 20:13:20 [holochain::test-instance] store_entry_content/puid-3-4 /Users/me/.cargo/git/checkouts/holochain-rust-c3b6365fc5bfa642/7d38b33/core/src/workflows/ workflow/hold_entry: Entry HcSCiusMpqD9tfas5yOKZ5cOkYsqrkwaoK8a3oBR7J6Yjpz3ztxmsOeDkgbthfz is NOT valid! Validation error: Error(ErrorGeneric("Failed to validate agent ID on a zome, [Error(ErrorGeneric(\"I/O Error: UnexpectedEof\"))]"))
ERROR 2019-09-20 20:13:20 [holochain::test-instance] store_entry_content/puid-3-4 /Users/me/.cargo/git/checkouts/holochain-rust-c3b6365fc5bfa642/7d38b33/core/src/network/handler/ net/dht: Failed to validate agent ID on a zome, [Error(ErrorGeneric("I/O Error: UnexpectedEof"))]

Any idea what it might be related to ?
It seems that my genesis function is failing since 0.0.29, and it could be linked (for info my genesis function is only trying to insert data linked to the agent’s pubKey)

Thanks in advance

Can you post the screenshot of your zome code and provide more details?

Sure. It’s pretty much the default app generated by hc generate zomes/myentry, so here’s the folder structure:

For the validate_agent() function I tried both with only returning Ok(()) and with the example given in the docs page you sent me.

And then here’s the content of the key files:

extern crate hdk;
extern crate serde;
extern crate serde_derive;
extern crate serde_json;
extern crate holochain_json_derive;

use hdk::{
use hdk::holochain_core_types::{

use hdk::holochain_persistence_api::{

use hdk::holochain_json_api::{

// see for info on using the hdk library

// This is a sample zome that defines an entry type "MyEntry" that can be committed to the
// agent's chain via the exposed function create_my_entry

#[derive(Serialize, Deserialize, Debug, DefaultJson,Clone)]
pub struct MyEntry {
    content: String,

pub fn handle_create_my_entry(entry: MyEntry) -> ZomeApiResult<Address> {
    let entry = Entry::App("my_entry".into(), entry.into());
    let address = hdk::commit_entry(&entry)?;

pub fn handle_get_my_entry(address: Address) -> ZomeApiResult<Option<Entry>> {

fn definition() -> ValidatingEntryType {
        name: "my_entry",
        description: "this is a same entry defintion",
        sharing: Sharing::Public,
        validation_package: || {

        validation: | _validation_data: hdk::EntryValidationData<MyEntry>| {

define_zome! {
    entries: [

    init: || { Ok(()) }

    validate_agent: |validation_data : EntryValidationData::<AgentId>| {{
        if let EntryValidationData::Create{entry, ..} = validation_data {
            let agent = entry as AgentId;
            if agent.nick == "reject_agent::app" {
                Err("This agent will always be rejected".into())
            } else {
        } else {
            Err("Cannot update or delete an agent at this time".into())

    functions: [
        create_my_entry: {
            inputs: |entry: MyEntry|,
            outputs: |result: ZomeApiResult<Address>|,
            handler: handle_create_my_entry
        get_my_entry: {
            inputs: |address: Address|,
            outputs: |result: ZomeApiResult<Option<Entry>>|,
            handler: handle_get_my_entry

    traits: {
        hc_public [create_my_entry,get_my_entry]

The conductor config is (template, gets generated by a makefile, see below):

bridges = []
persistence_dir = ''
ui_bundles = []
ui_interfaces = []

id = 'hc-run-agent'
keystore_file = 'testAgent'
name = 'testAgent'
public_address = 'HcScjN8wBwrn3tuyg89aab3a69xsIgdzmX5P9537BqQZ5A7TEZu7qCY4Xzzjhma'
test_agent = true

file = "{{ c.DNA_FILE_PATH }}"
hash = "{{ c.DNA_HASH }}"
id = 'hc-run-dna'

agent = 'hc-run-agent'
dna = 'hc-run-dna'
id = 'test-instance'
    type = 'memory'

admin = true
id = 'websocket-interface'
    port = 8888
    type = 'websocket'
    id = 'test-instance'
admin = true
id = 'http-interface'
    port = 4000
    type = 'http'
    id = 'test-instance'

# ---------  Network  ----------

bootstrap_nodes = [
n3h_log_level = 'i'
n3h_mode = 'REAL'
n3h_persistence_path = '{{ c.NH3_FOLDER }}'
type = 'n3h'

# ----------  Other  -----------

type = 'cmd'

consistency = false
trace = false

# ----------  Logs  -----------

state_dump = true
type = 'debug'
    exclude = true
    pattern = '.*'
    exclude = false
    pattern = '^holochain'
    exclude = false
    pattern = '^lib3h'

And I launch the whole thing with a makefile (I’ll including only the key lines here)

.DEFAULT_GOAL := hcconf
hcconf: deps gen-keys build 
	@tera -f hcconf_tpl.toml --env > .cache/hcconf.gen.toml
	holochain -c .cache/hcconf.gen.toml
	hc package -o ${DNA_FILE_PATH}

# deps sets holochain and hc to 0.0.29, and rust to 1.38-nightly
# tera is what renders the holochain_config template

Thanks in advance

Hi @nmrshll
I believe this is actually a bug.
I’m also getting the same thing. I’ll make an issue on the github and have a look at solving it. Hopefully it’s not blocking you.

Thanks for the detailed report.

Great to know it’s not just me.

And thanks for taking the feedback into consideration.

When you have the issue created, do you mind posting a link back here for anyone (including me) to follow the progress on it ?

Looks like someone else has already opened an issue for this. I added a comment to it thought and will start having a dig.

Looks like I know that someone else and have a pretty short memory :slight_smile: Thanks for putting the link here

1 Like

Oh I didn’t even pick up on that haha

This is now fixed. It was a strange bug that only sometimes appeared and was to do with artifacts in the .dna.json being treated as zomes when they are not. Because validate_agent needs to run the callback in every zome this was causing an EOF error. Rebuilding with a never version of the hc tool should fix this for you.

1 Like

Thank you !