I noticed that at the times the issue happens (the storage is not mounted after a restart) the ctx.filesystems map is empty (the filesystem of the storage is missing there) and then https://github.com/juju/juju/blob/juju-2.9.37/worker/storageprovisioner/storageprovisioner.go#L339 is called (which doesn't mount the storage as the filesystem is missing). The other times, ctx.filesystems is populated with the storage that is needed, so the storage is mounted.
One more detail that may be helpful:
I noticed that at the times the issue happens (the storage is not mounted after a restart) the ctx.filesystems map is empty (the filesystem of the storage is missing there) and then https:/ /github. com/juju/ juju/blob/ juju-2. 9.37/worker/ storageprovisio ner/storageprov isioner. go#L339 is called (which doesn't mount the storage as the filesystem is missing). The other times, ctx.filesystems is populated with the storage that is needed, so the storage is mounted.