Dropbox configuration with OH2

HI All,

I migrated a while ago my OH1 to OH2. I used to use the Dropbox synchronization service. Then it failed to work.
Now I just noticed in the documentation that Dropbox is working again, great!
So I did follow the instruction here: http://docs.openhab.org/addons/io/dropbox/readme.html
My app is active on dropbox and I tried to use the personal Access Token.
I have added the dropbox 1.9 jar to my addon folder.

If I list the bundles in the OH2 console I see the service 216 | Active | 80 | 1.9.0 | openHAB Dropbox IO Bundle.
When I am starting OH2 I am seeing this at the beginning of the log:
2017-06-20 22:28:52.451 [INFO ] [dropbox.internal.DropboxSynchronizer] - #########################################################################################
2017-06-20 22:28:52.455 [INFO ] [dropbox.internal.DropboxSynchronizer] - # Dropbox-Integration: U S E R I N T E R A C T I O N R E Q U I R E D !!
2017-06-20 22:28:52.460 [INFO ] [dropbox.internal.DropboxSynchronizer] - # 1. Open URL 'https://www.dropbox.com/1/oauth2/authorize?locale=en_GB&client_id=gbrwwfzvrw6a9uv&response_type=code’
2017-06-20 22:28:52.461 [INFO ] [dropbox.internal.DropboxSynchronizer] - # 2. Allow openHAB to access Dropbox
2017-06-20 22:28:52.463 [INFO ] [dropbox.internal.DropboxSynchronizer] - # 3. Paste the authorisation code here using the command 'finishAuthentication “”'
2017-06-20 22:28:52.466 [INFO ] [dropbox.internal.DropboxSynchronizer] - #########################################################################################

But the URL is not correct and refer to an inactive dropbox app.
Anyway I do not want to go via the appkey/appsecret.

  • Does anybody of you managed to make it working?

If yes any idea what I can do to make it working?

Thanks,
OvO

I am getting errors and warnings in the log and it does not work for me either:

2017-07-01 15:35:09.444 [ERROR] [org.openhab.io.dropbox ] - [org.openhab.io.dropbox(258)] Error during instantiation of the implementation object

java.lang.NoClassDefFoundError: Could not initialize class org.openhab.io.dropbox.internal.DropboxSynchronizer

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_121]

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_121]

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_121]

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_121]

at java.lang.Class.newInstance(Class.java:442)[:1.8.0_121]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:236)[31:org.apache.felix.scr:2.0.6]

at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:108)[31:org.apache.felix.scr:2.0.6]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)[31:org.apache.felix.scr:2.0.6]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)[31:org.apache.felix.scr:2.0.6]

at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823)[31:org.apache.felix.scr:2.0.6]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_121]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.apache.felix.cm.impl.helper.BaseTracker.getRealService(BaseTracker.java:205)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:102)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1772)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]

at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

2017-07-01 15:35:09.454 [WARN ] [org.openhab.io.dropbox ] - FrameworkEvent WARNING - org.openhab.io.dropbox

org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

at org.apache.felix.cm.impl.helper.BaseTracker.getRealService(BaseTracker.java:205)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:102)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1772)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]

at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]

at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

I am getting the same exact errors as @Gargam3L0, the binding is not functional for me.

I also am getting similar errors.

openHABian 1.3, openHAB release 2.1.0, running on a Raspberry Pi 3.

For me dropbox sync is also not working

Hi @Ovomaltin.

I have just reverified that the original 1.9 dropbox addon works when using OH2 2.0:

01:04:00.003 [DEBUG] [dropbox.internal.DropboxSynchronizer] - Started synchronization from Dropbox to local ...
01:04:00.513 [DEBUG] [dropbox.internal.DropboxSynchronizer] - There are no deltas to download from Dropbox ...
[...]
01:04:10.003 [DEBUG] [dropbox.internal.DropboxSynchronizer] - Started synchronization from local to Dropbox ...

You shouldn’t be getting any of those [INFO] lines if your config is set up correctly.
Can you post your dropbox.cfg file? (redacting your personal access key, of course)

Tomorrow I’ll look into trying this with OH2 2.1…

I can confirm that installing a fresh 2.1.0 version of OH results in the errors noted by @Gargam3L0 above.

Interestingly, if I use the 1.9 version of the dropbox jar, the errors go away and sync jobs are scheduled as expected. So that appears to be a viable workaround for the time being.

Now to figure out what got broken in 1.10.0…

@Gargam3L0, would you like to log an issue against the OH1-addons tracker?

EDIT: I’m not sure where this belongs any longer. There’ve been no changes to the dropbox binding, so it shouldn’t be an OH1 problem. Why then does it fail for the 1.10.0 jar but not for the 1.9 jar? I don’t grok it.

Where do you get the 1.9 jar and where do I need to place it to replace the 1.10 jar file?

One source is: bintray /org/openhab/io/org.openhab.io.dropbox/1.9.0

Direct download Link for 1.9 jar

Uninstall the 1.10 from PaperUI, stop OH2, download 1.9 jar in /usr/share/openhab2/addons/, start OH2

1 Like

I went ahead an logged this in ESH.

Let’s see if it gets any attention.

The ESH issue was rejected. Copied it to OH-core, but it looks like that also will be deemed not the right source. So I’m back to the drawing board looking for a cause in OH1-addons.

Did you try placing the 1.10 addon in the addons folder after uninstalling it from paperUI? I noticed a similar issue with another 2.1) binding that worked for me when installed through the folder, but only partially worked when installed through paperUI. As I cannot narrow down the issue more, I left it at that for now, but this might be a more general issue with the framework in 2.1.

Hi,
I have the same issue, OH2.1 and addon 1.10. I tried what @Mherwege suggested but the error is still there.
The 1.9 jar, has already implemented the personalAccessToken way (I tried with no success)? Otherwise, since the karaf console doesn’t see the command dropbox:finishAuthentication it cannot be configured.

Thank you.

I’ve just finished a fix for this.

I logged a new defect in OH1-addons for which I will soon create a PR. In the meantime, here’s a test jar for anyone who’d like to try out the fix.

I’d like to have at least a couple confirmations that this works before I merge my fix.

For me it does not cause errors anymore (OH 2.2 Snapshot)
But I did not yet get it to sync anything, what is likely an configuration problem I think?
What is the correct configuration for OH2 ?

At a restart of OH2 I got this:

2017-07-14 19:09:47.260 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.io.dropbox-1.11.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.io.dropbox [11]
  Unresolved requirement: Import-Package: org.openhab.core.binding
	at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)[4:org.apache.felix.fileinstall:3.5.6]

As long as you’ve got your dropbox.cfg edited up, that should be all you need.

You might have to uninstall the binding and reinstall it, and/or search for cached configs under userdata/ and eliminate them.

Just with default settings? I only added the personalAccessToken and LOCAL_TO_DROPBOX

2017-07-15 11:10:17.737 [INFO ] [dropbox.internal.DropboxSynchronizer] - #########################################################################################
2017-07-15 11:10:17.738 [INFO ] [dropbox.internal.DropboxSynchronizer] - # Starting auth using personal access token
2017-07-15 11:10:17.738 [INFO ] [dropbox.internal.DropboxSynchronizer] - #########################################################################################

Should be fine. You’ll get the defaults for the other settings.

Those log messages are expected and should indicate things are working well up to that point in the log.

Hi All,

I am fighting to have the 1.11 binding replacing the 1.10 version.
The 1.11 binding jar file is in /usr/share/openhab2/addons folder but it never appear in the paper UI.
I see only the 1.10 version.
What is also strange is that in paperUI the 1.10 appear with status uninstalled.
But when I start openhab in the log I get the error:
2017-07-20 23:59:49.883 [ERROR] [org.openhab.io.dropbox ] - [org.openhab.io.dropbox(14)] Error during instantiation of the implementation object
java.lang.ExceptionInInitializerError

So it looks like openhab is starting the dropbox bundle on version 1.10

Then if I check teh karaf console I have:
openhab> bundle:list | grep Drop
9 | Resolved | 80 | 1.9.0 | openHAB Dropbox IO Bundle
221 | Active | 80 | 1.11.0.201707140139 | openHAB Dropbox IO Bundle
227 | Active | 80 | 1.11.0.201707160110 | openHAB Dropbox IO Bundle

openhab> feature:list | grep dropbox
openhab-misc-dropbox1 | 1.10.0 | | Uninstalled | addons-2.1.0 | Dropbox Synchronization Service
openhab-misc-dropbox1 | 1.10.0 | | Uninstalled | openhab-addons-2.1.0 | Dropbox Synchronization Service
openhab>

It has no sense for me…

Any idea how I can get rid of this mess?

Thanks in advance

Uninstall dropbox until it no longer shows up in the bundle list. Then shutdown OH and remove the jar from the addons folder.

Restart OH and check the bundle list again. If Dropbox still present, repeat the uninstalls again. Wash, rinse, repeat.

When you can start OH without seeing dropbox started, then you can shut it down and put the latest jar back in the addons folder.

This is the only method I’ve found that works.