Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: map: Cannot add new entries in existing file. #236

Open
ghost opened this issue Jan 29, 2022 · 2 comments
Open

API: map: Cannot add new entries in existing file. #236

ghost opened this issue Jan 29, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jan 29, 2022

Hello,

I have a strange issue with the map handler.
When I try to add a new entrie in existing file on my server, I have the following result :

Request & Body :

# curl -X POST http://haproxy-prod-tools-01/v2/services/haproxy/runtime/maps_entries?map=test&force_sync=true
{
    "key": "my_key",
    "value": "my_value"
}

Result :

{"code":404,"message":"/etc/haproxy/maps/test.map not found"}

image

I tried with empty file or not, adding custom path in dataplaneapi configuration, updating access on file and the result was the same 404.

This is my misstake or this a real issue ?

HAProxy version 2.5.0
HAProxy Data Plane API v2.3.0

@mjuraga
Copy link
Collaborator

mjuraga commented Feb 14, 2022

Hi, does the dataplaneapi have the correct permissions on that file?

@hujiko
Copy link

hujiko commented Jul 25, 2022

Hey,

we experience the same issue.

What we discovered: When we create the map files by hand and then try and fill them through dataplaneapi, we see this error.
When we create the map files through the dataplane-api, they work alright.

root@myMachine:/etc/haproxy/maps# ls -lha
drwxr-x--- 2 root root 4.0K Jul 22 16:06 .
drwxr-xr-x 6 root root 4.0K Jul 25 12:49 ..
-rw-r--r-- 1 root root 1.6K Jul 12 18:09 routing-main-preview.map
-rw-r--r-- 1 root root    0 May 23 11:05 routing.map

routing.map was created by hand, routing-main-preview.map through the dataplaneapi. Both have the same owner, group and permissions.
(Unless the dataplaneapi sets some special xattrs when creating a map file, but I am lacking this in documentation)

@mjuraga mjuraga added the bug Something isn't working label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants