Up to three other men are said to have been involved in the incident between Lochside Road and Burnett Avenue in Lochside.
It happened between 1.15 pm and 2.10 pm.
Police are carrying out door to door enquiries to establish the facts and DS Lee Moscrop said: “We are keen to hear from anyone who may have used this path yesterday, at any time, and in particular from anyone who may have seen any suspicious activity in the area.”
Anyone with any information is asked to call officers at Dumfries on 101, or if they want, anonymously, through Crimestoppers on 0800 555 111.