{"error":"no handler found for uri [/_plugins/_sm/policies/snapshot_policy] and method [POST]"}

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2.0.1
Server OS: Ubuntu 22.04 in LXC guest; LXC host: Debian Bookworm
Graylog: 5.0.3+a82acb2 (open/community edition)

Describe the issue:
I am attempting to set a snapshot policy with the following:

curl -XPOST -v http://127.0.0.1:9200/_plugins/_sm/policies/snapshot_policy -H 'Content-Type: application/json' -d '{ "description": "Snapshot Schedule", "creation": { "schedule": { "cron": { "expression": "0 5 * * *", "timezone": "UTC" } }, "time_limit": "None" }, "deletion": { "schedule": { "cron": { "expression": "0 0 * * *", "timezone": "UTC" } }, "condition": { "max_age": "90d", "min_count": 7 }, "time_limit": "None" }, "snapshot_config": { "date_format": "yyyy-MM-dd", "timezone": "UTC", "indices": "*", "repository": "my-fs-repository", "ignore_unavailable": "true", "include_global_state": "false", "partial": "true", "metadata": { "any_key": "any_value" } } }'

but receive this error:

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 127.0.0.1:9200...
* Connected to 127.0.0.1 (127.0.0.1) port 9200 (#0)
> POST /_plugins/_sm/policies/snapshot_policy HTTP/1.1
> Host: 127.0.0.1:9200
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 556
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< content-type: application/json; charset=UTF-8
< content-length: 95
<
* Connection #0 to host 127.0.0.1 left intact
{"error":"no handler found for uri [/_plugins/_sm/policies/snapshot_policy] and method [POST]"}

Configuration:

# ======================== OpenSearch Configuration =========================
#
# NOTE: OpenSearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.opensearch.org
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: graylog
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: graylogopen
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /graylog/opensearch/data
#
# Path to log files:
#
path.logs: /var/log/opensearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# OpenSearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 127.0.0.1
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
discovery.type: single-node
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["SERVERNAME01", "SERVERNAME02", "SERVERNAME03"]
#
# Bootstrap the cluster using an initial set of cluster-manager-eligible nodes:
#
#cluster.initial_cluster_manager_nodes: ["SERVERNAME01", "SERVERNAME02", "SERVERNAME03"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
action.auto_create_index: false
plugins.security.disabled: true
path.repo: ["/media/RAID5/graylog-open/opensearch"]

Relevant Logs or Screenshots:
Nothing in the opensearch logs (though, admittedly, the logs are configured as advised by Graylog). The verbose output is pasted, above.

Any suggestions? Thank you!

@Gsmitt or @user481937 - would you be able to assist on this one?

2 Likes

Hey @1in14MM605

First, My apologies its been a while since i did this , but in my person documention ill share with you.

Opensearch Creating A Snapshot

Configure opensearch.yaml file.

path: "/etc/opensearch/my_repo"

Configuration made in Opensearch.yml file.

path.repo: ["/etc/opensearch/my_repo"]

Restart Opensearch service.

Reason, is Opensearch owns its own directory :wink:
NOTE: I used PUT not POST

curl -X PUT "localhost:9200/_snapshot/my_repo?pretty" -H 'Content-Type: application/json' -d'
{
"type": "fs",
"settings": {
"location": "/etc/opensearch/my_repo"
}
}
'

Once completed run the following.

curl -X PUT "localhost:9200/_snapshot/my_repo/snapshot_1?wait_for_completion=true&pretty"

Hope that helps

1 Like

you rock @Gsmitt! thank you

awesome-yes-will-ferrell (1)

Thanks @kris

1 Like

Hey gang, thank you for all the replies! Unfortunately, the issue may be unsolvable in my particular environment. As mentioned above, I use OpenSearch with Graylog. Automatic Snapshots is a pay-for feature in Graylog. Consequently, it is my belief that Graylog has nerfed OpenSearch by way of a non-standard Java install. The full discussion along with a workaround is here:
OpenSearch Snapshot Plugin Issue - Graylog Central (peer support) - Graylog Community (I am “AccidentalAdmin” over there)
Many thanks to @Gsmitt who is doing some heavy lifting on two sites :slight_smile:

1 Like

Hey @1in14MM605

If you do have a free/paid license then you are correct. Graylog Operation plugin will over ride those settings.

Hey AccidentalAdmin :smiley:

I try, These Opensearch dudes are pretty awesome in my book, bunch of great people.

2 Likes

Oh for sure! The Open Source Community for both OpenSearch and Graylog is off the charts amazing!

3 Likes