lebe-dev / zabbix-api-rs

Zabbix API for Rust
MIT License
4 stars 2 forks source link

ERROR zabbix_api::tests::builder] item create error: zabbix api call error #10

Closed tjyang closed 9 months ago

tjyang commented 9 months ago

running 12 tests test client::v6::tests::get_api_info ... ok test client::v6::tests::create_host_group_and_host ... ok test client::v6::tests::get_host_groups_test ... ok test client::v6::tests::create_trigger ... FAILED test client::v6::tests::create_item ... ok test client::v6::tests::create_web_scenario ... ok test client::v6::tests::get_hosts_test ... ok test client::v6::tests::get_items_test ... ok test client::v6::tests::get_triggers_test ... ok test client::v6::tests::session_should_be_returned ... ok test client::v6::tests::raw_api_call_test ... ok test client::v6::tests::get_webscenarios_test ... ok

failures:

---- client::v6::tests::create_trigger stdout ---- [2024-01-28T08:44:03Z INFO zabbix_api::client::v6] getting auth session for user 'Admin'.. [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] send post request to 'http://localhost:3080/api_jsonrpc.php' [2024-01-28T08:44:03Z DEBUG reqwest::connect] starting new connection: http://localhost:3080/ [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[HTTP RESPONSE]---- [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] {"jsonrpc":"2.0","result":"e1da90fc6d41b96971dd4028cf26e20a","id":1} [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[/HTTP RESPONSE]---- [2024-01-28T08:44:03Z INFO zabbix_api::client::v6] auth ok [2024-01-28T08:44:03Z INFO zabbix_api::client::v6] creating host group '8gIkLuWjBT'.. [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] send post request to 'http://localhost:3080/api_jsonrpc.php' [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[HTTP RESPONSE]---- [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] {"jsonrpc":"2.0","result":{"groupids":["26"]},"id":1} [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[/HTTP RESPONSE]---- [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] [response body] [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] {"jsonrpc":"2.0","result":{"groupids":["26"]},"id":1} [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] [/response body] [2024-01-28T08:44:03Z INFO zabbix_api::client::v6] host group '8gIkLuWjBT' has been created [2024-01-28T08:44:03Z INFO zabbix_api::client::v6] creating host 'kAY6LHLQLdpAqmdADGD'.. [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] send post request to 'http://localhost:3080/api_jsonrpc.php' [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[HTTP RESPONSE]---- [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] {"jsonrpc":"2.0","result":{"hostids":["10563"]},"id":1} [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[/HTTP RESPONSE]---- [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] [response body] [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] {"jsonrpc":"2.0","result":{"hostids":["10563"]},"id":1} [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] [/response body] [2024-01-28T08:44:03Z INFO zabbix_api::client::v6] host 'kAY6LHLQLdpAqmdADGD' has been created [2024-01-28T08:44:03Z INFO zabbix_api::client::v6] creating item with key 'keyF5ra6' for host id 10563.. [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] send post request to 'http://localhost:3080/api_jsonrpc.php' [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[HTTP RESPONSE]---- [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] {"jsonrpc":"2.0","error":{"code":-32500,"message":"Application error.","data":"DBEXECUTE_ERROR"},"id":1} [2024-01-28T08:44:03Z DEBUG zabbix_api::client::post] ---[/HTTP RESPONSE]---- [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] [response body] [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] {"jsonrpc":"2.0","error":{"code":-32500,"message":"Application error.","data":"DBEXECUTE_ERROR"},"id":1} [2024-01-28T08:44:03Z DEBUG zabbix_api::client::v6] [/response body] [2024-01-28T08:44:03Z ERROR zabbix_api::client::v6] ZabbixError { code: -32500, message: "Application error.", data: "DBEXECUTE_ERROR" } Caused by: [zabbix error] code -32500, message 'Application error.', data: 'DBEXECUTE_ERROR' [/zabbix error] [2024-01-28T08:44:03Z ERROR zabbix_api::tests::builder] item create error: zabbix api call error thread 'client::v6::tests::create_trigger' panicked at src/tests/builder.rs:143:17: zabbix api call error note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

failures: client::v6::tests::create_trigger

test result: FAILED. 11 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.95s

error: test failed, to rerun pass --lib [me@rocky9t01a zabbix-api-rs]$

tjyang commented 9 months ago

running 12 tests test client::v6::tests::get_api_info ... ok test client::v6::tests::create_web_scenario ... ok test client::v6::tests::create_host_group_and_host ... ok test client::v6::tests::create_item ... ok test client::v6::tests::get_host_groups_test ... ok test client::v6::tests::create_trigger ... ok test client::v6::tests::get_hosts_test ... ok test client::v6::tests::get_items_test ... ok test client::v6::tests::get_triggers_test ... ok test client::v6::tests::session_should_be_returned ... ok test client::v6::tests::raw_api_call_test ... ok test client::v6::tests::get_webscenarios_test ... ok

test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.93s

Doc-tests zabbix-api

running 2 tests test src/client/mod.rs - client::ZabbixApiClient::get_hosts (line 37) ... ok test src/client/mod.rs - client::ZabbixApiClient::create_host (line 88) ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.92s

[me@rocky9t01a zabbix-api-rs]$