Problem connecting to Azure Service Bus using rabbitmq-amqp1.0-client - azure

I'm trying to connect Azure Service Bus (AMQP 1.0) using this erlang client: https://github.com/rabbitmq/rabbitmq-amqp1.0-client
The elixir wrapper library https://github.com/pma/amqp doesn't seem like using AMQP 1.0. So I'm trying to use the erlang client directly.
I did the following:
git clone https://github.com/rabbitmq/rabbitmq-amqp1.0-client.git
cd rabbitmq-amqp1.0-client
make
make shell
Then I created a config as per the README file at https://github.com/rabbitmq/rabbitmq-amqp1.0-client
OpnConf = #{address => Hostname,
port => Port,
hostname => <<"abc-shankardevy.servicebus.windows.net">>,
tls_opts => {secure_port, [{versions, ['tlsv1.1']}]},
container_id => <<"test-container">>,
transfer_limit_margin => 100,
sasl => {plain, User, Password}}.
When I try to open the connection as in the README, I get the following error. I'm not able to follow the erlang error message. Any help is appreciated.
{ok, Connection} = amqp10_client:open_connection(OpnConf).
** exception exit: {noproc,{gen_server,call,
[amqp10_client_sup,
{start_child,[#{address =>
'abc-shankardevy.servicebus.windows.net',
container_id => <<"test-container">>,
hostname => <<"abc-shankardevy.servicebus.windows.net">>,
notify => <0.111.0>,port => 5671,
sasl =>
{plain,'RootManageSharedAccessKey',
'mykey'},
tls_opts => {secure_port,[{versions,['tlsv1.1']}]},
transfer_limit_margin => 100}]},
infinity]}}
in function gen_server:call/3 (gen_server.erl, line 223)
in call from amqp10_client_connection:open/1 (src/amqp10_client_connection.erl, line 110)

Try "starting" the application first:
application:ensure_all_started(amqp10_client).
It's complaining about not finding a certain process (noproc), namely the one called amqp10_client_sup. This process is started when the application is started, by this piece of code:
-module(amqp10_client_app).
-behaviour(application).
-export([start/2,
stop/1]).
start(_Type, _Args) ->
amqp10_client_sup:start_link().

Related

puppet migration: v3.8.5 -> v5.4.0 "Could not find template"

I'm migrating a from puppetmaster on Xenial (v3.8.5) to Bionic (v5.4.0) and have run into an issue. So far I've copied the node and modules files from the old server to the new and had a client connect. I keep getting the following error on the client and master:
Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find template 'ntp/client_ntp.conf.erb' (file: /etc/puppet/code/environments/production/manifests/modules/ntp/manifests/init.pp, line: 17, column: 20) on node owain18.dimerocker.com
The template file exists at: /etc/puppet/code/environments/production/manifests/modules/ntp/templates/client_ntp.conf.erb
The contents of ntp/manifests/init.pp:
class ntp {
package { "ntp": }
file { "/etc/ntp.conf":
mode => "644",
content => template("ntp/client_ntp.conf.erb"),
notify => Service["ntp"],
require => Package["ntp"],
} # file
service { "ntp":
ensure => running,
enable => true,
require => Package["ntp"],
} # service
} # class ntp
(I removed some comments from the top of the file so the line number in the error doesn't match, but there's no code missing.)
Any pointers on how to fix this issue? Thanks for your help.

Voximal - Cannot test the application

I've just installed the app on my asterisk 14 and i got some problems.
I've created this account in voximal.conf
[account2]
number=8000
name=test1
url=file:///var/lib/voximal/test.vxml
This is the content of my test.vxml
<?xml version="1.0"?>
<vxml version = "2.0" xmlns="http://www.w3.org/2001/vxml">
<form>
<block><audio src="hello.wav"/></block>
</form>
</vxml>
This is the content of my extensions.conf file
exten => 8000,1,Answer
exten => 8000,n,Wait(2)
exten => 8000,n,Voximal(test1)
exten => 8000,n,Hangup
And this is what I get when I call 8000 on my softphone
Executing [8000#from-internal:1] Answer("PJSIP/marc-00000005", "") in new stack
> 0x7fcbfc150140 -- Strict RTP learning after remote address set to: 192.168.79.1:40034
> 0x7fcbfc150140 -- Strict RTP switching to RTP target address 192.168.79.1:40034 as source
-- Executing [8000#from-internal:2] Wait("PJSIP/marc-00000005", "2") in new stack
> 0x7fcbfc150140 -- Strict RTP learning complete - Locking on source address 192.168.79.1:40034
-- Executing [8000#from-internal:3] Voximal("PJSIP/marc-00000005", "test1") in new stack
[Jan 3 09:15:56] ERROR[48508][C-00000006]: app_voximal.c:20285 vxml_exec: Cannot open new session, allocating context!
-- Executing [8000#from-internal:4] Hangup("PJSIP/marc-00000005", "") in new stack
I've tried this to identify the error:
exten => 8000,1,Voximal()
exten => 8000,n,NoOp(${VOXIMAL_ERROR})
exten => 8000,n,GotoIf($["${VOXIMAL_ERROR}" == ""]?hangup)
exten => 8000,n,Busy()
exten => 8000,n(hangup),Hangup()
And I got this:
Executing [8000#from-internal:1] Voximal("PJSIP/marc-00000000", "") in new stack
[Jan 3 09:28:08] ERROR[48842][C-00000001]: app_voximal.c:20285 vxml_exec: Cannot open new session, allocating context!
-- Executing [8000#from-internal:2] NoOp("PJSIP/marc-00000000", "LICENSE") in new stack
-- Executing [8000#from-internal:3] GotoIf("PJSIP/marc-00000000", "0?hangup") in new stack
-- Executing [8000#from-internal:4] Busy("PJSIP/marc-00000000", "") in new stack
Please help me!
The error : vxml_exec: Cannot open new session, allocating context!
It is because you didn't have enable the free 1 port of Voximal.
Have a look to your Voxiaml Licence with :
CLI> voximal show license
The default configuration needs an Internet connection to get the license.
If you are testing in a secure network, you need to set the key=evaluation (in the voximal.conf file or from the Web Interface) to enable localy the test/dev/free license.

Index not creating from couchdb with logstash Logstash

I am using this config file to create index/import data from couchdb.
input {
couchdb_changes {
db => "roles"
host => "localhost"
port => 5984
}
}
output {
elasticsearch {
document_id => "%{[#metadata][_id]}"
document_type => "%{[#metadata][type]}"
host => "localhost"
index => "roles_index"
protocol => "http"
host => localhost
port => 9200
}
}
I was able to run logstash with this config file and import data
once. I closed command prompt to shutdown logstash and reran cmd prompt
and stash with the config file again. but now I cannot see any index
created. Is there anything that I might be doing wrong here. I am using
ctl+c to kill logstash in cmd prompt. Will appreciate any help.
Thanks.
in case someone comes here looking for the answer of same thing...I set sequence_path => "my_couchdb_seq" in couchdb_changes { } section of my config file and it worked. Each time i want to run logstash to create index, value in this file should be replaced with 0. Got to link: https://discuss.elastic.co/t/index-not-creating-from-couchdb-with-logstash/27848/9 for details

SaltStack: Create a server via salt-cloud and set endpoints autmatically in Azure?

I'm a bit stuck with my server deployment recipes...
So far, I can create and provision my servers via commandline:
First I run salt-cloud and afterwards I provision it via salt-ssh...
But since I'm using some special ports (https,...) I also have to set/open input/endpoints (=ports) on Microsoft Azure.
This is where I stuck: is there any way of telling salt-cloud, to automatically execute a script, which opens the endpoints automatically?
My preferred result would be:
run salt-cloud => sets up new machine and opens all necessary ports
run salt-ssh to provision them
I have already looked at salt orchestration, but it looks like it's more for server fleets, instead of single (external) server configuration.
Any hints?
You could write a custom bootstrap script that would open the ports that you want.
As Utah_Dave said, I wrote a ruby script to add the ports...
# ruby
# execute with ruby startscript.rb
require 'json'
PROVIDER = "yourprovider"
SERVER = "yourserver"
ENDPOINTS = {
"SSH2" => 17532,
"HTTPS" => 443,
"HTTP" => 80,
"SlangerHTTP" => 8080,
"Slanger" => 4567,
"CouchDB" => 5984
}
def get_missing
service_existing = false
while !service_existing
begin
res = `salt-cloud --out=json -f list_input_endpoints #{PROVIDER} deployment=#{SERVER} service=#{SERVER}`
result = JSON.parse(res)
service_existing = true
rescue => e
puts e
end
end
existing_services = result[PROVIDER]["azure"].keys
missung_services = ENDPOINTS.keys - existing_services
end
missung_services = get_missing
while missung_services.any?
print "#{Time.now} [#{SERVER}] Services missing: #{missung_services.join(", ")}"
missung_services.each do |m|
print "."
`salt-cloud --out=json -f add_input_endpoint #{PROVIDER} name=#{m} port=#{ENDPOINTS[m]} protocol=tcp deployment=#{SERVER} service=#{SERVER} role=#{SERVER}`
end
print "\n"
missung_services = get_missing
end

Puppet notify service error

I try to write a puppet configuration in order to install lamp env.
But i have an issue with notify option.
I have an apache conf:
class apache inherits apache::params {
package { 'apache':
name => "${apache::params::package}",
ensure => present
}
service { 'apache':
ensure => running,
name => $apache::params::service,
enable => true,
subscribe => Package['apache'],
}
}
and and php module conf:
define php::module(
$notify = $php::params::notify,
$package_prefix = $php::params::module_package_prefix
) {
package { "php-module-${name}":
ensure => present,
name => "${package_prefix}${name}",
notify => Service['apache'],
require => [Class['apache'], Package['php', 'php-dev']]
}
}
but when I launch puppet I have this error:
Error: Parameter notify failed on Php::Module[mcrypt]: No title provided and "apache" is not a valid resource reference
I don't understand why it said that apache service is not a valid resources ?
I think there might be 2 issues here:
1) Puppet doesn't like this line in php::module:
$notify = $php::params::notify,
Can you try to remove that or check what is in $php::params::notify? (I don't see you using it)
2) Did you have something like
include apache
in your site.pp? The class still needs to be declared before you can reference the contained resources.

Resources