Community
OpenEnergyMonitor

Community

Problem setting up EmonCMS Sync - PHP errors

billing
sync
Tags: #<Tag:0x00007f1fea698c80> #<Tag:0x00007f1fea6989d8>

(Trystan Lea) #41

Ok that’s fine I wanted to check if you had it running or not. Running sync_run manually should also work, if you first click on the feeds you wish to download and then run sync_run that should then run through the feeds you wish to download.


(daturach) #42

Your trick works just fine without using the service runner.

I have now checked all my feeds. There are a few I can’t download. I don’t know if this is related to the issue
you opened in Github. Maybe you could have a quick look. Here are the IDs:
117369
122402
122403
122404
122405
131181
131182
131187

Regarding the dashboards:
At some point you said you are working on it. That’s fine. I just would like to report a message I got
when running the download process from the web interface:

Fatal error:  Uncaught Error: Call to a member function bind_param() on boolean in /home/pi/sync/sync-module/sync_controller.php:344
Stack trace:
#0 /var/www/emoncms/core.php(64): sync_controller()
#1 /var/www/emoncms/index.php(189): controller('sync')
#2 {main}
  thrown in /home/pi/sync/sync-module/sync_controller.php on line 344

Thanks

Walter


(Paul) #43

Would it not make sense to move the service-runner to the emoncms repo? We can expand the emoncms install guide to include the service-runner rather than documenting how to install the whole emonpi repo, setup and use the service-runner in each module repo that uses it.


(Trystan Lea) #44

Yes I think that’s a good idea, it makes sense that it can be used for different self-hosted setups. Perhaps to be reviewed alongside @Paul and your suggestions about wider emoncms installation changes.


(Roger Campbell) #45

When I sync’d with this I got the list of inputs with all the processing lists intact but the feed in each case was the first feed in the feed list. I went through all of the inputs correcting this but now when I display the feeds the waiting symbol appears in the browser and finally the error:

Notice: Array to string conversion in /var/www/emoncms/Theme/basic/theme.php on line 165
Array.

Also I don’t have either of my multigraphs present, shouldn’t they have copied too?


(daturach) #46

@TrystanLea
It looks to me there is a problem downloading feeds if their names contain square brackets.
I have renamed such feeds and now I can download them.
That resolved problem reported in some of my feeds.

I have still a few “ERROR” in Process list. I will try to fix them and report if I can’t.
Thanks


(daturach) #47

@TrystanLea
I have fixed all my errors. The dashboards are now working. I was missing the modules…That’s why I was getting an error in “sync_controller.php on line 344”.

A few processes were on “Errors”. I just recreated them.
So far so good…
Thanks
Walter


(Lee) #48

Same here, I couldn’t get the Sync module to Sync the data out, but the Backup module worked great after I deleted the folders & reset the permissions as suggest in the other thread. The Sync module then copied over all the Dashboards correctly, and the Inputs (with Process Lists) mostly OK. I had to manually fix some of the feeds it was logging to for some reason. It’s now seems to logging locally OK, a few days of testing will hopefully confirm all is well.


(Dimitar Kazakov) #49

Hi,
I have setup sync module, and now it appears in Setup area. When I fill up Host, Username, Password and press Connect, then it try to connect and failed with authentication failure. I checked Host, Username and Password in a browser for the remote host and they are correct.
When I check apache error log I can see following PHP warning and errors every time sync module is trying to connect remote host:

PHP Notice: Trying to get property ‘host’ of non-object in /home/emoncms/sync/sync-module/sync_controller.php on line 50, referer: https://emoncms.domain.com/sync/view
PHP Notice: Trying to get property ‘apikey_read’ of non-object in /home/emoncms/sync/sync-module/sync_controller.php on line 50, referer: https://emoncms.domain.com/sync/view
PHP Warning: file_get_contents(/feed/listwithmeta.json?apikey=): failed to open stream: No such file or directory in /home/emoncms/sync/sync-module/sync_controller.php on line 50, referer: https://emoncms.domain.com/sync/view
PHP Warning: Invalid argument supplied for foreach() in /home/emoncms/sync/sync-module/sync_controller.php on line 82, referer: https://emoncms.domain.com/sync/view

Looks like sync_controller cannot initialize $remote object properly.
Is there any PHP or PECL modules required for sync module to operate properly for http, as well https remote hosts?

BR
Dimitar


(Trystan Lea) #50

Hello @kazak, is you remote server emoncms version up to date? The /feed/listwithmeta.json end point is relatively recent. Have you also run emoncms database update after installing the sync module?


(Dimitar Kazakov) #51

Hi,
Seems I’ve overlooked database update and sync table is missing. After database updated and sync table in place, everything is OK with sync module now. Thank you!