Often ships from other nations will just sit outside native settlements or (less commonly) other nations' cities, doing nothing. I'm guessing they are trying to sell items or something, but it means their ships are stuck for years at a time. Usually they don't leave until I attack them with a privateer. If it's a selling issue maybe they should try to sell twice or something, and after that cancel the trip.
I have noticed this as well. Example.
My guess is they have problems with pathfinding.
There is nothing useful the developers can do with the level of information supplied here. I say this a lot, but please think about reproducibility. A screen shot is fine to establish that a problem exists, a log file is great especially if there is a crash, but if you want us to examine misbehaviour by the AI across multiple turns (i.e. the most complex part of the game, and also the worst implemented), saved games are needed.
Please note: I totally believe this happens, and is a real bug. The AI sucks, we know this. I appreciate the log file... which alas had nothing relevant in it. However without the ability to run a game with all the AI instrumentation turned on while it is doing what you report, there is little hope of progress here.
Aha, I got up to BR#3228 where the same issue was reported, with saved games. Closing this report as a duplicate.