There is an error just before "mongo" not found
error. If you follow the stacktrace a little bit more, you’ll see
packaging command failed: exit status 1; cmd: "snap install core"; output: error: unable to contact snap store
So it seems like you’re unable to connect the snap store.