Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with js-controller 1.4.0 #70

Open
xmace opened this issue Mar 13, 2018 · 8 comments
Open

issue with js-controller 1.4.0 #70

xmace opened this issue Mar 13, 2018 · 8 comments

Comments

@xmace
Copy link

xmace commented Mar 13, 2018

The adapter worked well since I updated the js-controller to latest version 1.3.0.

`

host.iobrokerVM 2018-03-13 10:15:29.054 info Do not restart adapter system.adapter.tr-064.0 because disabled or deleted
host.iobrokerVM 2018-03-13 10:15:29.054 error instance system.adapter.tr-064.0 terminated with code 1 ()
Caught 2018-03-13 10:15:29.054 error by controller[0]: at bootstrap_node.js:608:3
Caught 2018-03-13 10:15:29.054 error by controller[0]: at startup (bootstrap_node.js:187:16)
Caught 2018-03-13 10:15:29.054 error by controller[0]: at Function.Module.runMain (module.js:684:10)
Caught 2018-03-13 10:15:29.054 error by controller[0]: at Function.Module._load (module.js:491:3)
Caught 2018-03-13 10:15:29.054 error by controller[0]: at tryModuleLoad (module.js:499:12)
Caught 2018-03-13 10:15:29.054 error by controller[0]: at Module.load (module.js:556:32)
Caught 2018-03-13 10:15:29.054 error by controller[0]: at Object.Module._extensions..js (module.js:654:10)
Caught 2018-03-13 10:15:29.053 error by controller[0]: at Module._compile (module.js:643:30)
Caught 2018-03-13 10:15:29.053 error by controller[0]: at Object. (/opt/iobroker/node_modules/iobroker.tr-064/tr-064.js:16:20)
Caught 2018-03-13 10:15:29.053 error by controller[0]: at Object.exports.Adapter (/opt/iobroker/node_modules/soef/soef.js:1383:23)
Caught 2018-03-13 10:15:29.053 error by controller[0]: TypeError: fns.adapter is not a function
Caught 2018-03-13 10:15:29.053 error by controller[0]: ^
Caught 2018-03-13 10:15:29.053 error by controller[0]: fns.adapter = fns.adapter(options);
Caught 2018-03-13 10:15:29.052 error by controller[0]: /opt/iobroker/node_modules/soef/soef.js:1383
host.iobrokerVM 2018-03-13 10:15:22.124 info object change system.adapter.tr-064.0

`

@Soulguard
Copy link

^^same here^^
Adapter worked well since update js-controller to 1.3.0

@xmace
Copy link
Author

xmace commented Mar 16, 2018

push

@sm79
Copy link

sm79 commented Mar 29, 2018

I had the same issue last night - found out the following:

In

/opt/iobroker/node_modules/soef/soef.js:1383

the function call fns.adapter(options) doesn't work, because at this point fns.adapter was not created.

The reason can be found some lines above:

 if (!fns.adapter) { 
     var _modules = [ process.mainModule.filename.replace(/lightify.js$/, ''+ 'lib/utils',
         __dirname + '/../iobroker.admin/lib/utils', 
         __dirname + '/../../lib/utils' 
     ]

With js-controller 1.3.0 (at my system), the directory /../iobroker.admin was removed.
Also the other directories were not existing.
So fns.adapter could not be created due to missing utils.js.

My Workaround:
Find a suitable utils.js in any directory within "/opt/iobroker/node_modules/"
I found one in directory "iobroker.kodi" - so adding the following line worked for me:

__dirname + '/../iobroker.kodi/lib/utils',

Now the section looks like:

 if (!fns.adapter) { 
     var _modules = [ process.mainModule.filename.replace(/lightify.js$/, ''+ 'lib/utils',
         __dirname + '/../iobroker.admin/lib/utils', 
         __dirname + '/../iobroker.kodi/lib/utils',
         __dirname + '/../../lib/utils' 
     ]

I know this is really dirty, but it was late last night!

Finding:
Writing this text I found that with js-controller 1.3.0, the directory iobroker.admin was (by accident?) moved to "/opt/iobroker/node_modules/iobroker.js-controller/node_modules/".
So the utils.js is now here:

/opt/iobroker/node_modules/iobroker.js-controller/node_modules/iobroker.admin/lib/utils.js

I don't know (yet) if this is intended or not @GermanBluefox.
If so, the following line could probably be added to soef.js:

         __dirname + '/../iobroker.js-controller/node_modules/iobroker.admin/lib/utils',

@xmace xmace changed the title issue with js-controller 1.3.0 issue with js-controller 1.4.0 Apr 4, 2018
@xmace
Copy link
Author

xmace commented Apr 4, 2018

and again

host.iobrokerVM 2018-04-04 23:50:04.007 error instance system.adapter.tr-064.0 terminated with code 1 ()
Caught 2018-04-04 23:50:04.007 error by controller[0]: at bootstrap_node.js:608:3
Caught 2018-04-04 23:50:04.007 error by controller[0]: at startup (bootstrap_node.js:187:16)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at Function.Module.runMain (module.js:684:10)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at Function.Module._load (module.js:491:3)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at tryModuleLoad (module.js:499:12)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at Module.load (module.js:556:32)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at Object.Module._extensions..js (module.js:654:10)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at Module._compile (module.js:643:30)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at Object. (/opt/iobroker/node_modules/iobroker.tr-064/tr-064.js:16:20)
Caught 2018-04-04 23:50:04.006 error by controller[0]: at Object.exports.Adapter (/opt/iobroker/node_modules/soef/soef.js:1383:23)
Caught 2018-04-04 23:50:04.006 error by controller[0]: TypeError: fns.adapter is not a function
Caught 2018-04-04 23:50:04.005 error by controller[0]: ^
Caught 2018-04-04 23:50:04.005 error by controller[0]: fns.adapter = fns.adapter(options);
Caught 2018-04-04 23:50:04.005 error by controller[0]: /opt/iobroker/node_modules/soef/soef.js:1383

@drecksgekritzel
Copy link

I have the same problem since i have updated my js controller...

@R-Guhr
Copy link

R-Guhr commented May 4, 2018

I have the same problem.

@GreenRa
Copy link

GreenRa commented May 25, 2018

Hi, I have the same Problem since I updated my js-controller from version 1.2.3 to version 1.4.2 today.
If there any workaround available yet?

Supplement: The Workaround described by sm79 some comments above worked for me!

@jogibear9988
Copy link

This issue was moved to iobroker-community-adapters/ioBroker.tr-064#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants