Error with almost nothing in sitemaps

Hi,

here is my sitemap file:

sitemap maison label="Maison"
{
 Frame label="Maison" {
		Text label="Exterieur"
	}
}

When I tail the logs and I make a change to this file (exemple: changing the name of the text label), I get the following error:

11:07:22.545 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file '/etc/openhab2/sitemaps/maison.sitemap': null.
java.lang.NullPointerException
        at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.getAllItems(PageChangeListener.java:125)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
        at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.updateItemsAndWidgets(PageChangeListener.java:75)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
        at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.sitemapContentChanged(PageChangeListener.java:217)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
        at org.eclipse.smarthome.io.rest.sitemap.SitemapSubscriptionService.modelChanged(SitemapSubscriptionService.java:277)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:286)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:136)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:234)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processWatchEvent(FolderObserver.java:297)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
        at org.eclipse.smarthome.core.service.WatchQueueReader.run(WatchQueueReader.java:206)[98:org.eclipse.smarthome.core:0.9.0.b5]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]

My rules are working fine and when I access the webpage, I can see the text label so it appears fine but I don’t know why I get this error

I see this consistently on one sitemap. The sitemap renders fine. Oddly, if I copy that sitemap to a another sitemap file (and change the name of the sitemap inside the new sitemap file), I don’t see the error when I update that new sitemap. From that we might be able to infer that it’s not the content of the sitemap, but rather an internal condition/state that causes it.

It may go away after a restart, but I haven’t tried that yet (it’s doing this on one of my prod systems, and I try to not restart it too often).

@Kai Any pointers on what debugging to enable to help track this down?

If it consistently fails with the sitemap shown above, I would say no additional logging is required and it is clearly a bug that should be reported at https://github.com/eclipse/smarthome/issues.

Well, I wasn’t quite sure what to report, but that might’ve just changed. :slight_smile:

What I’ve been able to determine so far is a bit odd.

  • If I edit the sitemap file (using vi) when ssh’ed into my openhab box, the exception DOES NOT occur.

  • If I edit the sitemap file (using notepad++ and VS Code) from another box where the file is exposed through a Samba share, the exception DOES occur.

@starcraft04 How are you editing the sitemap file?

Issue opened.

1 Like

Exactly the same as you, I edit it via samba share in notepad++