cocaine/cocaine-core

Start Locator service restircted

Alukardd opened this issue · 16 comments

Hello.

I'm trying to start cocaine-runtime with cocaine-default.conf from package and want to get minimal cluster configuration.
When I try to run cocaine-tool info I get error in service "locator" - service is not available [1]
Old cocaine-tools from reverbrain repo stuch on info command, and in log appears message: [E]: uncaught invocation exception: [4] 0: specified channel was revoked [service: locator, endpoint: [::1]:48620, source: core:asio, engine: 0x7f37c4b63700]

My config:

{
    "version": 3,
    "logging": {
        "core" : {
            "loggers": [
                {
                    "formatter": {
                        "type": "string",
                        "pattern": "[%(timestamp)s] [%(severity)s]: %(message)s %(...:[:])s"
                    },
                    "sink": {
                        "type": "syslog",
                        "identity": "cocaine"
                    }
                }
            ],
            "timestamp": "%Y-%m-%d %H:%M:%S.%f",
            "verbosity": "debug"
        }
    },
    "network": {
        "pinned": {
            "locator": 10053
        }
    },
    "paths": {
        "plugins": "/usr/lib/cocaine",
        "runtime": "/var/run/cocaine"
    },
    "services": {
        "locator": {
            "type": "locator",
            "args": {
                "cluster": {
                    "type": "multicast",
                    "args": {
                        "group": "239.0.100.53"
                    }
                },
                "gateway": {
                    "type": "adhoc"
                }
            }
        },
        "logging": {
            "type": "logging",
            "args": {
                "backend": "core"
            }
        },
        "storage": {
            "type": "storage",
            "args": {
                "backend": "core"
            }
        }
    },
    "storages": {
        "core": {
            "type": "files",
            "args": {
                "path": "/var/lib/cocaine"
            }
        },
        "cache": {
            "type": "files",
            "args": {
                "path": "/var/cache/cocaine"
            }
        }
    }
}

Restricted services are not advertised to aggregating nodes on network – it has nothing to do with actually being able to resolve a service with cocaine-tool. Can you paste log output here? You can redirect logs to stdout by changing the logging section like this:

"sink": {
    "type": "stream",
    "output": "stdout"
}

from syslog

cocaine-runtime[6738]: [Runtime] Parsing the configuration.
cocaine[6743]: [2015-10-16 15:47:45.918349] [I]: initializing the server
cocaine[6743]: [2015-10-16 15:47:45.923217] [I]: initializing the core [source: core]
cocaine[6743]: [2015-10-16 15:47:45.923836] [D]: registering component 'multicast' in category 'cocaine::api::cluster_t' [source: core]
cocaine[6743]: [2015-10-16 15:47:45.924508] [D]: registering component 'predefine' in category 'cocaine::api::cluster_t' [source: core]
cocaine[6743]: [2015-10-16 15:47:45.925056] [D]: registering component 'adhoc' in category 'cocaine::api::gateway_t' [source: core]
cocaine[6743]: [2015-10-16 15:47:45.925587] [D]: registering component 'locator' in category 'cocaine::api::service_t' [source: core]
cocaine[6743]: [2015-10-16 15:47:45.926152] [D]: registering component 'logging' in category 'cocaine::api::service_t' [source: core]
cocaine[6743]: [2015-10-16 15:47:45.926674] [D]: registering component 'storage' in category 'cocaine::api::service_t' [source: core]
cocaine[6743]: [2015-10-16 15:47:45.927231] [D]: registering component 'files' in category 'cocaine::api::storage_t' [source: core]
cocaine[6743]: [2015-10-16 15:47:45.928113] [I]: starting 2 execution unit(s) [source: core]
cocaine[6743]: [2015-10-16 15:47:45.928795] [D]: engine started [source: core, engine: 0x7fdbcf31e700]
cocaine[6743]: [2015-10-16 15:47:45.929386] [D]: engine started [source: core, engine: 0x7fdbceb1d700]
cocaine[6743]: [2015-10-16 15:47:45.929431] [I]: starting 3 service(s) [source: core]
cocaine[6743]: [2015-10-16 15:47:45.929477] [D]: starting service [source: core, service: locator]
cocaine[6743]: [2015-10-16 15:47:45.930971] [I]: restricting 1 service(s): locator [source: core, service: locator]
cocaine[6743]: [2015-10-16 15:47:45.931048] [I]: using 'multicast' as a cluster manager, enabling synchronization [source: core, service: locator]
cocaine[6743]: [2015-10-16 15:47:45.931189] [I]: joining multicast group '239.0.100.53:10053' [uuid: 9982e83b-b246-4088-ae83-824da63a5d2e, source: core, service: locator]
cocaine[6743]: [2015-10-16 15:47:45.931442] [I]: using 'adhoc' as a gateway manager, enabling service routing [source: core, service: locator]
cocaine[6743]: [2015-10-16 15:47:45.932598] [D]: enqueued sending routing updates to 0 router(s) [source: core, service: locator]
cocaine[6743]: [2015-10-16 15:47:45.933137] [I]: exposing service on local endpoint [::]:10053 [source: core, service: locator]
cocaine[6743]: [2015-10-16 15:47:45.933290] [D]: service has been started [service: locator, source: core]
cocaine[6743]: [2015-10-16 15:47:45.933669] [D]: starting service [source: core, service: logging]
cocaine[6743]: [2015-10-16 15:47:45.934903] [I]: exposing service on local endpoint [::]:52709 [source: core, service: logging]
cocaine[6743]: [2015-10-16 15:47:45.935009] [D]: service has been started [service: logging, source: core]
cocaine[6743]: [2015-10-16 15:47:45.935245] [D]: starting service [source: core, service: storage]
cocaine[6743]: [2015-10-16 15:47:45.936350] [I]: exposing service on local endpoint [::]:40839 [source: core, service: storage]
cocaine[6743]: [2015-10-16 15:47:45.936456] [D]: service has been started [service: storage, source: core]
cocaine[6743]: [2015-10-16 15:47:45.936846] [D]: enqueued sending service updates to 0 locators [service: logging, source: locator]
cocaine[6743]: [2015-10-16 15:47:45.936926] [D]: enqueued sending service updates to 0 locators [service: storage, source: locator]
cocaine[6743]: [2015-10-16 15:47:45.937126] [D]: announcing 2 local endpoint(s) [uuid: 9982e83b-b246-4088-ae83-824da63a5d2e, source: locator:cluster]

cocaine-tool info --debug all

[2015-10-16 18:45:04,674] baseservice cocaine.baseservice:163 DEBUG   : _invoke has been called () {}
[2015-10-16 18:45:04,675] service cocaine.baseservice:54 DEBUG   : checking if service connected
[2015-10-16 18:45:04,675] service cocaine.baseservice:59 INFO    : resolving ...
[2015-10-16 18:45:04,675] baseservice cocaine.baseservice:163 DEBUG   : _invoke has been called ('node',) {}
[2015-10-16 18:45:04,675] baseservice cocaine.baseservice:93 INFO    : acquiring the connection lock
[2015-10-16 18:45:04,676] baseservice cocaine.baseservice:102 INFO    : trying localhost:10053 to establish connection locator
[2015-10-16 18:45:04,677] baseservice cocaine.baseservice:114 INFO    : connection has been established successfully 1.623ms
[2015-10-16 18:45:04,678] baseservice cocaine.baseservice:169 DEBUG   : {0: ['resolve', {}, {0: ['value', {}], 1: ['error', {}]}], 1: ['connect', {}, {0: ['write', None], 1: ['error', {}], 2: ['close', {}]}], 2: ['refresh', {}, {0: ['value', {}], 1: ['error', {}]}], 3: ['cluster', {}, {0: ['value', {}], 1: ['error', {}]}], 4: ['publish', {0: ['discard', {}]}, {0: ['value', {}], 1: ['error', {}]}], 5: ['routing', {}, {0: ['write', None], 1: ['error', {}], 2: ['close', {}]}]}
[2015-10-16 18:45:04,678] baseservice cocaine.baseservice:172 DEBUG   : method `resolve` has been found in API map
[2015-10-16 18:45:04,678] baseservice cocaine.baseservice:174 DEBUG   : sending message: [1, 0, ('node',)]
[2015-10-16 18:45:04,679] baseservice cocaine.baseservice:179 DEBUG   : RX TREE {0: ['value', {}], 1: ['error', {}]}
[2015-10-16 18:45:04,679] baseservice cocaine.baseservice:180 DEBUG   : TX TREE {}
[2015-10-16 18:45:04,679] baseservice cocaine.baseservice:141 DEBUG   : read 
¸service is not availableÏPÏQÏR
[2015-10-16 18:45:04,680] baseservice cocaine.baseservice:144 DEBUG   : unpacked: [1, 1, [[10, 1], 'service is not available'], [80, 81, 82]]
[2015-10-16 18:45:04,680] baseservice cocaine.baseservice:147 DEBUG   : 1, 1, [[10, 1], 'service is not available']
[2015-10-16 18:45:04,680] channel cocaine.channel:138 DEBUG   : dispatch ['error', {}] [[10, 1], 'service is not available']
[2015-10-16 18:45:04,680] channel cocaine.channel:143 DEBUG   : name `error` rx `{}`
[2015-10-16 18:45:04,681] baseservice cocaine.baseservice:120 DEBUG   : disconnect has been called locator
[2015-10-16 18:45:04,682] baseservice cocaine.baseservice:135 DEBUG   : pipe has been closed ('',) locator
[2015-10-16 18:45:04,682] baseservice cocaine.baseservice:137 DEBUG   : the epoch matches. Call disconnect
[2015-10-16 18:45:04,682] baseservice cocaine.baseservice:120 DEBUG   : disconnect has been called locator
[2015-10-16 18:45:04,683] cli cocaine.tools:52 ERROR   : error in service "locator" - service is not available [1]
[2015-10-16 18:45:04,688] baseservice cocaine.baseservice:120 DEBUG   : disconnect has been called locator
[2015-10-16 18:45:04,688] baseservice cocaine.baseservice:120 DEBUG   : disconnect has been called node
[2015-10-16 18:45:04,689] baseservice cocaine.baseservice:120 DEBUG   : disconnect has been called locator

You should install node plugin: https://github.com/cocaine/cocaine-plugins
I think, that the error message is not clear. There's no information which service was unresolved.
cocaine-tool info tries to resolve node service.

3Hren commented

There's no information which service was unresolved

Here it is!

tries to resolve node service.

I need this package in Debian Jessie.
I tried to recursively build all dependencies, but cocaine-plugins doesn't compiled with it.
At first I tried to build latest blackhole, but latest swarm builded only with v0.2 branch of blackhole repo.
Ok. I have blackhole-dev package version 0.2.3.3 and swarm3(and company) version 3.2.0.1.
All compiled with libboost version 1.55.

When I try to compile cocaine-plugin I got next error

/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/foreign/blackhole/src/blackhole/logger/wrapper.hpp:189:5: note:   candidate expects 2 arguments, 0 provided
elasticsearch/CMakeFiles/elasticsearch.dir/build.make:57: recipe for target 'elasticsearch/CMakeFiles/elasticsearch.dir/src/elasticsearch.cpp.o' failed
make[3]: *** [elasticsearch/CMakeFiles/elasticsearch.dir/src/elasticsearch.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/usr/bin/cmake -E cmake_progress_report "/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/obj-x86_64-linux-gnu/CMakeFiles" 17
[ 31%] Building CXX object ipvs/CMakeFiles/ipvs-gateway.dir/module.cpp.o
cd "/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/obj-x86_64-linux-gnu/ipvs" && /usr/lib/ccache/c++   -Dipvs_gateway_EXPORTS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O2 -g -DNDEBUG -fPIC -isystem "/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/foreign/rapidjson/include" -isystem "/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/foreign/blackhole/src" -isystem "/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/foreign/asio/asio/include"    -std=c++0x -o CMakeFiles/ipvs-gateway.dir/module.cpp.o -c "/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/ipvs/module.cpp"

In file included from /usr/include/swarm/logger.hpp:25:0,
                 from /usr/include/swarm/urlfetcher/url_fetcher.hpp:23,
                 from /tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/include/cocaine/urlfetch.hpp:27,
                 from /tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:18:
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/foreign/blackhole/src/blackhole/log.hpp:4:2: warning: #warning <blackhole/log.hpp> file is deprecated, use <blackhole/logger.hpp> plus <blackhole/macro.hpp> instead [-Wcpp]
 #warning <blackhole/log.hpp> file is deprecated, use <blackhole/logger.hpp> plus <blackhole/macro.hpp> instead
  ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:39:1: error: expected class-name before '{' token
 {
 ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp: In member function 'virtual void urlfetch_logger_interface::log(int, const char*)':
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:49:21: error: 'ioremap::swarm::blackhole' has not been declared
         case swarm::SWARM_LOG_ERROR:
                     ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:51:21: error: 'ioremap::swarm::blackhole' has not been declared
         case swarm::SWARM_LOG_INFO:
                     ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:53:21: error: 'ioremap::swarm::blackhole' has not been declared
         case swarm::SWARM_LOG_NOTICE:
                     ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:55:21: error: 'ioremap::swarm::blackhole' has not been declared
         case swarm::SWARM_LOG_DEBUG:
                     ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:56:14: error: 'SWARM_LOG_DATA' is not a member of 'ioremap::swarm'
         case swarm::SWARM_LOG_DATA:
              ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp: In constructor 'cocaine::service::urlfetch_t::urlfetch_t(cocaine::context_t&, asio::io_service&, const string&, const cocaine::dynamic_t&)':
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:81:58: error: 'ioremap::swarm::blackhole' has not been declared
     m_logger(new urlfetch_logger_interface(log_), swarm::SWARM_LOG_DEBUG),
                                                          ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:84:56: error: no matching function for call to 'ioremap::swarm::boost_event_loop::boost_event_loop(boost::asio::io_service&)'
     m_work(new boost::asio::io_service::work(m_service))
                                                        ^
/tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:84:56: note: candidate is:
In file included from /tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/include/cocaine/urlfetch.hpp:28:0,
                 from /tmp/buildd/cocaine-plugins-0.12.4.1+0~20151019111718.5+jessie~1.gbp3a32f0/urlfetch/src/urlfetch.cpp:18:
/usr/include/swarm/urlfetcher/boost_event_loop.hpp:37:2: note: ioremap::swarm::boost_event_loop::boost_event_loop(boost::asio::io_service&, const logger&)
  boost_event_loop(boost::asio::io_service &service, const swarm::logger &logger);
  ^
/usr/include/swarm/urlfetcher/boost_event_loop.hpp:37:2: note:   candidate expects 2 arguments, 1 provided
urlfetch/CMakeFiles/urlfetch.dir/build.make:57: recipe for target 'urlfetch/CMakeFiles/urlfetch.dir/src/urlfetch.cpp.o' failed
make[3]: *** [urlfetch/CMakeFiles/urlfetch.dir/src/urlfetch.cpp.o] Error 1

Could you help me with building latest version of cocaine-plugins for Debian Jessie?

3Hren commented

Urlfetch requires Blackhole 0.2, while all entire environment builds only with 0.5.

You can either:

  • Suppress Urlfetch build.
  • Install blackhole 0.2 in a separate directory and include its header files additionally with the submodule ones.

Thanks!
Now its successfully compiled.
Who interested may see changes here — https://github.com/Alukardd/cocaine-plugins/commits/v0.12

But after I install libcocaine-plugin-node3 nothing changed.

# cocaine-tool info
error in service "locator" - service is not available [1]

In package there is lib /usr/lib/cocaine/node.2.cocaine-plugin.so

3Hren commented

You should now specify the Node service in config file to be loaded and configured.

Try to copy/paste the following subconfig in a services section:

"node": {
    "type": "node::v2",
    "args": {
        "runlist": "default"
    }
},

In syslog I have

cocaine[21741]: [2015-10-19 14:10:37.648678] [I]: loading plugin [source: core, plugin: /usr/lib/cocaine/node.2.cocaine-plugin.so]
cocaine[21741]: [2015-10-19 14:10:37.651633] [D]: registering component 'process' in category 'cocaine::api::isolate_t' [source: core, plugin: /usr/lib/cocaine/node.2.cocaine-plugin.so]
cocaine[21741]: [2015-10-19 14:10:37.655196] [D]: registering component 'node::v2' in category 'cocaine::api::service_t' [source: core, plugin: /usr/lib/cocaine/    node.2.cocaine-plugin.so]

But in config file I have line "version": 3 is this a problem?

3Hren commented

The version: 3 indicates the config file version, it's okay for you.

Ok. Thanks copy-paste works fine)

But that's a pity that package by default can't completely work...

3Hren commented

By default Cocaine provides no Node service (it's a plugin), so there is no configuration for it.

But without this plugin I can't start any app, aren't I?

3Hren commented

Yep, but the Cocaine can also be configured as an aggregation node with no Node service.

Ok. Thx!

3Hren commented

NP