Overpass dispatcher - How to solve File_Error Invalid argument 22 {DB_DIR}//osm3s_osm_base Unix_Socket::5?

Hello everyone. I have a local installation of the Overpass API, in a docker container.
Overpass API itself is working correctly and I can perform queries using using $EXEC_DIR/bin/osm3s_query --db-dir=$DB_DIR .
Now I’d like to set up the Web API .
That requires me to start the dispatcher process .
That’s where I’m facing an error.
When I execute the following command:
./dispatcher --osm-base --db-dir=$DB_DIR
it immediately throws the following error:
File_Error Invalid argument 22 $DB_DIR//osm3s_osm_base Unix_Socket::5
I can then see that the lock file is there in the $DB_DIR folder, but the dispatcher is not running.
Now if I try to run a query using osm3s_query, I get the following error:
runtime error: Context error: File $DB_DIR//osm3s_osm_base present, which indicates a running dispatcher. Delete file if no dispatcher is running.
If I move that file out of that folder, now I can execute queries again.
However, if I try to curl apache, I get the following error:
runtime error: The dispatcher (i.e. the database management system) is turned off.

Does anyone have an idea what else I could try to trouble shoot this issue ? Is there an obvious error there?

For the record, I’m running these commands with a user called overpass which is the owner of all of these folders listed above.

Thanks in advance,

When I execute the following command:
./dispatcher --osm-base --db-dir=$DB_DIR
it immediately throws the following error:
File_Error Invalid argument 22 $DB_DIR//osm3s_osm_base Unix_Socket::5

Thank you for posting the error and the precise error message.

There is only a single location in the code that trigger “Unix_Socket::5”:

    if (chmod(socket_name.c_str(), S_666) == -1)
      throw File_Error(errno, socket_name, "Unix_Socket::5");

These are standard flags in POSIX compliant systems, and POSIX
requires chmod(2) to fail on any flavor of permission problem before it looks at EINVAL.

In other words: something is extremely unlikely to be POSIX compliant here. I’m very happy if someone has an idea what is actually going on there on the operating system side.

To get the issue forward, can you please:

  • do an ls -l on the socket file and figure out what owner and file permissions are set
  • try to change the file manually with su overpass role by chmod 666 $SOCKET and report whether it returns an error and whether it has any effect on the file permissions

@drollbr - Thanks for your quick reply.

For the record, this is running within Docker and the host OS is MacOS, with the new M1-Pro chip as the processor.
I believe that chmod command should work though, unless there’s maybe a permission thing.
One thing of note though is that initially I performed the compilation using the root user, then later I have chown the entire /home folder recursively to the “overpass” user. Do you reckon that could be a problem?

Also, do you have any idea what this socket file name could be ? Is it perhaps the lock file it creates on the DB DIR ?
That file has the following flags:


Interestingly it’s got the equals sign on the name, which is odd:

Thanks in advance,

Please try to run version

This version makes the chmod fail silently and changes the length of the unix socket, officially not used by any OS, to not count the zero terminating byte.

@drollbr - Sorry for the delay in responding here, life has been crazy.
I wanted to say thank you very much, yeah that solved it!