I'm creating a system that will send texts every time a temperature sensor goes outwith the limit. I need this text to only be sent once but it keeps sending.
Code:
if(temp > (userTemp + 5.00))
{
ledState2=1;
device.send("led2", ledState2);
local smsState = 0; //State, if sms has been sent yet or not
if(smsState==0)
{
smsState=1;
//This is where the sms script will be put
server.log("SMS should send: " + smsState);
}
}
Output:
2014-11-20 10:12:58 UTC+0 [Device] Set RED LED: 1
2014-11-20 10:13:08 UTC+0 [Device] 22.3245
2014-11-20 10:13:08 UTC+0 [Agent] SMS should send: 1
2014-11-20 10:13:09 UTC+0 [Device] Set RED LED: 1
2014-11-20 10:13:18 UTC+0 [Device] 22.2814
2014-11-20 10:13:18 UTC+0 [Agent] SMS should send: 1
2014-11-20 10:13:19 UTC+0 [Device] Set RED LED: 1
2014-11-20 10:13:28 UTC+0 [Device] 22.3245
2014-11-20 10:13:28 UTC+0 [Agent] SMS should send: 1
2014-11-20 10:13:29 UTC+0 [Device] Set RED LED: 1
2014-11-20 10:13:38 UTC+0 [Device] 22.2814
2014-11-20 10:13:39 UTC+0 [Agent] SMS should send: 1
2014-11-20 10:13:39 UTC+0 [Device] Set RED LED: 1
2014-11-20 10:13:48 UTC+0 [Device] 22.3245
2014-11-20 10:13:49 UTC+0 [Agent] SMS should send: 1
2014-11-20 10:13:49 UTC+0 [Device] Set RED LED: 1
2014-11-20 10:13:58 UTC+0 [Device] 22.2814
2014-11-20 10:13:59 UTC+0 [Agent] SMS should send: 1
2014-11-20 10:13:59 UTC+0 [Device] Set RED LED: 1
2014-11-20 10:14:08 UTC+0 [Device] 22.3029
2014-11-20 10:14:09 UTC+0 [Agent] SMS should send: 1
I can't see why would keep sending the server.log
When i enter the smsState if statement that should only run once because i change the smsState to 1
This is on an electric imp if that changes anything but i don't think it does
It's pretty simple, really. Just add a variable that keeps track of whether or not the statement has been run.
local didSend = 0;
if(temp > (userTemp + 5.00) && !didSend)
{
didSend = 1;
ledState2=1;
device.send("led2", ledState2);
local smsState = 0; //State, if sms has been sent yet or not
if(smsState==0)
{
smsState=1;
//This is where the sms script will be put
server.log("SMS should send: " + smsState);
}
}
Now the if statement will not run again until you change didSend back to 0 again.
Related
I have configured error handling in my ASP.NET Core application:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
//app.UseStatusCodePagesWithRedirects("/api/v1/error/{0}");
app.UseStatusCodePagesWithReExecute("/api/v1/error/{0}");
app.UseExceptionHandler("/api/v1/error");
app.UseAuthentication();
app.UseMvc();
}
namespace JPSAPI.Controllers
{
[Produces("application/json")]
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/error")]
public class ErrorController : Controller
{
[HttpGet]
[Route("")]
public IActionResult ServerError()
{
var feature = this.HttpContext.Features.Get<IExceptionHandlerFeature>();
var content = new ExceptionMessageContent()
{
Error = "Unexpected Server Error",
Message = feature?.Error.Message
};
return Content(JsonConvert.SerializeObject(content), "application/json");
}
[HttpGet]
[Route("{statusCode}")]
public IActionResult StatusCodeError(int statusCode)
{
var feature = this.HttpContext.Features.Get<IExceptionHandlerFeature>();
var content = new ExceptionMessageContent();
content.Error = $"{statusCode}";
switch (statusCode)
{
case 401:
content.Error = "invalid_token";
content.Message = "Your login may have timed out, please log in again (401 Unauthorized)";
break;
default:
content.Message = $"Server Error! The Server responded with status code {statusCode}";
break;
}
//{ Error = "Server Error", Message = $"The Server responded with status code {statusCode}" };
return Content(JsonConvert.SerializeObject(content), "application/json");
}
}
}
Neither method is called the first time an error occurs. The methods are called on second and subsequent errors, until session timeout, and then it happens again (assuming session timeout because if I test after coming back from lunch the methods are skipped again on first try). I have placed breakpoints on both methods and neither breakpoint is called on the initial error.
I have tried using app.UseStatusCodePagesWithRedirects which does work on the initial error, but always returns success / 200 to the client which is undesired.
What am I doing wrong that prevents the initial error from being routed like all subsequent errors?
More information:
I am trying to handle exception errors (401, 404, 500 etc). For example, I am using JWT authentication and when testing one of the endpoints with Postman, if the token has expired or if it is invalid, a 401 error is returned (in the response header) the first time I hit the Postman send button, the error handler above is not called, and there isn't any JSON payload. If I hit send again in that very same Postman window, the error handler above is called, the JSON payload is returned to the client, and the client gets a 401 error response. It should be doing the latter every time an error is encountered, and never the former.
UPDATE: I guess I did not vet things enough before posting. The above description of events doesn't happen for 404 errors - those exceptions work fine. For the 401 errors, I can either wait for my token to expire, or stop and start the debug session, and it will happen again.
LOGS:
Below is the log information - using IIS Express. I ran Postman for the first time today and tried to access an endpoint twice without a valid token.
I then ran the debugger and tried the endpoint again twice with Postman, closed the debugger, waited a few minutes, and tried with Postman for the final time. Each time, the 401 error was returned, but the JSON payload was returned only with the second attempt.
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2018-03-02 17:10:32
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2018-03-02 17:10:32 ::1 GET /api/v1/userinfo - 49565 - ::1 PostmanRuntime/7.1.1 - 401 0 0 8316
2018-03-02 17:11:02 ::1 GET /api/v1/userinfo - 49565 - ::1 PostmanRuntime/7.1.1 - 401 0 0 522
2018-03-02 17:11:54 ::1 DEBUG / - 49565 - ::1 - - 400 0 64 9598
2018-03-02 17:11:55 ::1 GET /api/values - 49565 - ::1 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/64.0.3282.167+Safari/537.36 - 400 0 0 6671
2018-03-02 17:11:55 ::1 GET /favicon.ico - 49565 - ::1 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/64.0.3282.167+Safari/537.36 http://localhost:49565/api/values 404 0 0 447
2018-03-02 17:12:07 ::1 GET /api/v1/userinfo - 49565 - ::1 PostmanRuntime/7.1.1 - 401 0 0 448
2018-03-02 17:12:19 ::1 GET /api/v1/userinfo - 49565 - ::1 PostmanRuntime/7.1.1 - 401 0 0 181
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2018-03-02 17:37:48
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2018-03-02 17:37:48 ::1 GET /api/v1/userinfo - 49565 - ::1 PostmanRuntime/7.1.1 - 401 0 0 3533
2018-03-02 17:37:53 ::1 GET /api/v1/userinfo - 49565 - ::1 PostmanRuntime/7.1.1 - 401 0 0 484
This is actually a known issue: Problems using UseExceptionHandler() and UseStatusCodePagesWithReExecute() #221. It happens when using APIVersioning.
I used middleware from here to work around the issue: Handling errors in an ASP.NET Core Web API. Specifically the section on 'Custom Middleware'.
I'm setting up a wireless lab. User guest123 with password guest123
authenticates over wireless using 802.1X authentication. FreeRadius should
also return FilterId=>labguest. A rule at the wireless controller sets the
user role to whatever FilterId is returned during the RADIUS exchange.
Instead, the request/response churns ten times, and the user is assigned the
default role, "authenticated".
The brief questions before launching into details is what am I doing wrong,
and is there an automated tool to parse through FreeRadius -X output and
produce recommendations?
Simple command line tests from the wireless controller and freeradius show
both authentication and returned attributes.
Here's the part that works
From freeradius:
root#ubuntu/etc/freeradius# radtest guest123 guest123 localhost 0 testing123
User-Name = "guest123"
User-Password = "guest123"
NAS-IP-Address = 127.0.1.1
NAS-Port = 0
Message-Authenticator = 0x00
Cleartext-Password = "guest123"
Received Access-Accept Id 184 from 127.0.0.1:1812 to 0.0.0.0:0 length 36
Service-Type = Framed-User
Filter-Id = "labguest"
From Aruba controller:
The role "labguest" is defined here:
user-role labguest
access-list session global-sacl
access-list session apprf-labguest-sacl
access-list session "Cant ping controller"
access-list session allowall
access-list session v6-allowall
The rule to assign user role based on FilterId is here:
aaa server-group "lab-emp_srvgrp-kqh72"
auth-server radius1
set role condition Filter-Id value-of
Here's the part that is broken
After authenticating over wireless and 802.1X, the user receives the default
802.1X role, "authenticated" rather than "labguest".
(Master1) # show user mac 44:39:c4:59:e5:64
Name: guest123, IP: 192.168.16.23, MAC: 44:39:c4:59:e5:64, Age: 00:00:05
Role: authenticated (how: ROLE_DERIVATION_DOT1X), ACL: 70/0
Authentication: Yes, status: successful, method: 802.1x, protocol: EAP-PEAP, server: radius1
Authentication Servers: dot1x authserver: radius1, mac authserver:
Bandwidth = No Limit
Bandwidth = No Limit
Role Derivation: ROLE_DERIVATION_DOT1X
VLAN Derivation: Default VLAN
FreeRADIUS Version 3.0.15
<<<deleted debug output>>>
# Loading authenticate {...}
# Loading authorize {...}
# Loading preacct {...}
# Loading accounting {...}
# Loading post-proxy {...}
# Loading post-auth {...}
# server default
radiusd: #### Opening IP addresses and Ports ####
listen {
type = "auth"
ipaddr = 127.0.0.1
port = 18120
}
listen {
type = "auth"
ipaddr = *
port = 0
limit {
max_connections = 16
lifetime = 0
idle_timeout = 30
}
}
listen {
type = "acct"
ipaddr = *
port = 0
limit {
max_connections = 16
lifetime = 0
idle_timeout = 30
}
}
listen {
type = "auth"
ipv6addr = ::
port = 0
limit {
max_connections = 16
lifetime = 0
idle_timeout = 30
}
}
listen {
type = "acct"
ipv6addr = ::
port = 0
limit {
max_connections = 16
lifetime = 0
idle_timeout = 30
}
}
Listening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel
Listening on auth address * port 1812 bound to server default
Listening on acct address * port 1813 bound to server default
Listening on auth address :: port 1812 bound to server default
Listening on acct address :: port 1813 bound to server default
Listening on proxy address * port 50900
Listening on proxy address :: port 60069
Ready to process requests
(0) Received Access-Request Id 42 from 192.168.18.254:40607 to
192.168.18.249:1812 length 175
(0) User-Name = "guest123"
(0) NAS-IP-Address = 192.168.18.254
(0) NAS-Port = 0
(0) NAS-Identifier = "192.168.18.254"
(0) NAS-Port-Type = Wireless-802.11
(0) Calling-Station-Id = "4439C459E564"
(0) Called-Station-Id = "000B86BE91F0"
(0) Service-Type = Framed-User
(0) Framed-MTU = 1100
(0) EAP-Message = 0x0202000d016775657374313233
(0) Aruba-Essid-Name = "lab-emp"
(0) Aruba-Location-Id = "AP1"
(0) Aruba-AP-Group = "lab1"
(0) Message-Authenticator = 0x6780aa98cfe6f147e8334301882c9c1f
(0) # Executing section authorize from file /etc/freeradius/sites-enabled
/default
(0) authorize {
(0) policy filter_username {
(0) if (&User-Name) {
(0) if (&User-Name) -> TRUE
(0) if (&User-Name) {
(0) if (&User-Name =~ / /) {
(0) if (&User-Name =~ / /) -> FALSE
(0) if (&User-Name =~ /#[^#]*#/ ) {
(0) if (&User-Name =~ /#[^#]*#/ ) -> FALSE
(0) if (&User-Name =~ /\.\./ ) {
(0) if (&User-Name =~ /\.\./ ) -> FALSE
(0) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) {
(0) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) ->
FALSE
(0) if (&User-Name =~ /\.$/) {
(0) if (&User-Name =~ /\.$/) -> FALSE
(0) if (&User-Name =~ /#\./) {
(0) if (&User-Name =~ /#\./) -> FALSE
(0) } # if (&User-Name) = notfound
(0) } # policy filter_username = notfound
(0) [preprocess] = ok
(0) [chap] = noop
(0) [mschap] = noop
(0) [digest] = noop
(0) suffix: Checking for suffix after "#"
(0) suffix: No '#' in User-Name = "guest123", looking up realm NULL
(0) suffix: No such realm "NULL"
(0) [suffix] = noop
(0) eap: Peer sent EAP Response (code 2) ID 2 length 13
(0) eap: EAP-Identity reply, returning 'ok' so we can short-circuit the rest
of authorize
(0) [eap] = ok
(0) } # authorize = ok
(0) Found Auth-Type = eap
(0) # Executing group from file /etc/freeradius/sites-enabled/default
(0) authenticate {
(0) eap: Peer sent packet with method EAP Identity (1)
(0) eap: Calling submodule eap_ttls to process data
(0) eap_ttls: Initiating new EAP-TLS session
(0) eap_ttls: [eaptls start] = request
(0) eap: Sending EAP Request (code 1) ID 3 length 6
(0) eap: EAP session adding &reply:State = 0xedb76556edb4700e
(0) [eap] = handled
(0) } # authenticate = handled
(0) Using Post-Auth-Type Challenge
(0) # Executing group from file /etc/freeradius/sites-enabled/default
(0) Challenge { ... } # empty sub-section is ignored
(0) Sent Access-Challenge Id 42 from 192.168.18.249:1812 to
192.168.18.254:40607 length 0
(0) EAP-Message = 0x010300061520
(0) Message-Authenticator = 0x00000000000000000000000000000000
(0) State = 0xedb76556edb4700e88dcdd844646037b
(0) Finished request
Waking up in 4.9 seconds.
(1) Received Access-Request Id 43 from 192.168.18.254:40607 to
192.168.18.249:1812 length 186
(1) User-Name = "guest123"
(1) NAS-IP-Address = 192.168.18.254
(1) NAS-Port = 0
(1) NAS-Identifier = "192.168.18.254"
(1) NAS-Port-Type = Wireless-802.11
(1) Calling-Station-Id = "4439C459E564"
(1) Called-Station-Id = "000B86BE91F0"
(1) Service-Type = Framed-User
(1) Framed-MTU = 1100
(1) EAP-Message = 0x020300060319
(1) State = 0xedb76556edb4700e88dcdd844646037b
(1) Aruba-Essid-Name = "lab-emp"
(1) Aruba-Location-Id = "AP1"
(1) Aruba-AP-Group = "lab1"
(1) Message-Authenticator = 0xfe39826a334b5ddbe8fa4012037a87d8
(1) session-state: No cached attributes
(1) # Executing section authorize from file /etc/freeradius/sites-enabled
/default
(1) authorize {
(1) policy filter_username {
(1) if (&User-Name) {
(1) if (&User-Name) -> TRUE
(1) if (&User-Name) {
(1) if (&User-Name =~ / /) {
(1) if (&User-Name =~ / /) -> FALSE
(1) if (&User-Name =~ /#[^#]*#/ ) {
(1) if (&User-Name =~ /#[^#]*#/ ) -> FALSE
(1) if (&User-Name =~ /\.\./ ) {
(1) if (&User-Name =~ /\.\./ ) -> FALSE
(1) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) {
(1) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) ->
FALSE
(1) if (&User-Name =~ /\.$/) {
(1) if (&User-Name =~ /\.$/) -> FALSE
(1) if (&User-Name =~ /#\./) {
(1) if (&User-Name =~ /#\./) -> FALSE
(1) } # if (&User-Name) = notfound
(1) } # policy filter_username = notfound
(1) [preprocess] = ok
(1) [chap] = noop
(1) [mschap] = noop
(1) [digest] = noop
(1) suffix: Checking for suffix after "#"
(1) suffix: No '#' in User-Name = "guest123", looking up realm NULL
(1) suffix: No such realm "NULL"
(1) [suffix] = noop
(1) eap: Peer sent EAP Response (code 2) ID 3 length 6
(1) eap: No EAP Start, assuming it's an on-going EAP conversation
(1) [eap] = updated
(1) files: users: Matched entry guest123 at line 82
(1) [files] = ok
(1) sql: EXPAND %{User-Name}
(1) sql: --> guest123
(1) sql: SQL-User-Name set to 'guest123'
rlm_sql (sql): Reserved connection (0)
(1) sql: EXPAND SELECT id, username, attribute, value, op FROM radcheck
WHERE username = '%{SQL-User-Name}' ORDER BY id
(1) sql: --> SELECT id, username, attribute, value, op FROM radcheck
WHERE username = 'guest123' ORDER BY id
(1) sql: Executing select query: SELECT id, username, attribute, value, op
FROM radcheck WHERE username = 'guest123' ORDER BY id
rlm_sql_postgresql: Status: PGRES_TUPLES_OK
rlm_sql_postgresql: query affected rows = 0 , fields = 5
(1) sql: EXPAND SELECT groupname FROM radusergroup WHERE username = '%{SQL-
User-Name}' ORDER BY priority
(1) sql: --> SELECT groupname FROM radusergroup WHERE username =
'guest123' ORDER BY priority
(1) sql: Executing select query: SELECT groupname FROM radusergroup WHERE
username = 'guest123' ORDER BY priority
rlm_sql_postgresql: Status: PGRES_TUPLES_OK
rlm_sql_postgresql: query affected rows = 0 , fields = 1
(1) sql: User not found in any groups
rlm_sql (sql): Released connection (0)
Need 5 more connections to reach 10 spares
rlm_sql (sql): Opening additional connection (5), 1 of 27 pending slots used
rlm_sql_postgresql: Connecting using parameters: dbname=radius
host=localhost user=radius password=********
Connected to database 'radius' on 'localhost' server version 90510, protocol
version 3, backend PID 1714
(1) [sql] = notfound
(1) [expiration] = noop
(1) [logintime] = noop
(1) pap: WARNING: Auth-Type already set. Not setting to PAP
(1) [pap] = noop
(1) } # authorize = updated
(1) Found Auth-Type = eap
(1) # Executing group from file /etc/freeradius/sites-enabled/default
(1) authenticate {
(1) eap: Expiring EAP session with state 0xedb76556edb4700e
(1) eap: Finished EAP session with state 0xedb76556edb4700e
(1) eap: Previous EAP request found for state 0xedb76556edb4700e, released
from the list
(1) eap: Peer sent packet with method EAP NAK (3)
(1) eap: Found mutually acceptable type PEAP (25)
(1) eap: Calling submodule eap_peap to process data
(1) eap_peap: Initiating new EAP-TLS session
(1) eap_peap: [eaptls start] = request
(1) eap: Sending EAP Request (code 1) ID 4 length 6
(1) eap: EAP session adding &reply:State = 0xedb76556ecb37c0e
(1) [eap] = handled
(1) } # authenticate = handled
(1) Using Post-Auth-Type Challenge
(1) # Executing group from file /etc/freeradius/sites-enabled/default
(1) Challenge { ... } # empty sub-section is ignored
(1) Sent Access-Challenge Id 43 from 192.168.18.249:1812 to
192.168.18.254:40607 length 0
(1) Service-Type = Framed-User
(1) Framed-Filter-Id = "labguest"
(1) EAP-Message = 0x010400061920
(1) Message-Authenticator = 0x00000000000000000000000000000000
(1) State = 0xedb76556ecb37c0e88dcdd844646037b
(1) Finished request
Waking up in 4.9 seconds.
<<<deleted generally repeating debug output>>>
(10) Received Access-Request Id 52 from 192.168.18.254:40607 to 192.168.18.249:1812 length 223
(10) User-Name = "guest123"
(10) NAS-IP-Address = 192.168.18.254
(10) NAS-Port = 0
(10) NAS-Identifier = "192.168.18.254"
(10) NAS-Port-Type = Wireless-802.11
(10) Calling-Station-Id = "4439C459E564"
(10) Called-Station-Id = "000B86BE91F0"
(10) Service-Type = Framed-User
(10) Framed-MTU = 1100
(10) EAP-Message =
0x020c002b190017030100209568f164a54cf0e2aa3c<<<more deleted>>>
(10) State = 0xedb76556e4bb7c0e88dcdd844646037b
(10) Aruba-Essid-Name = "lab-emp"
(10) Aruba-Location-Id = "AP1"
(10) Aruba-AP-Group = "lab1"
(10) Message-Authenticator = 0x2277c43d40495abc84afcfee2d7af56b
(10) session-state: No cached attributes
(10) # Executing section authorize from file /etc/freeradius/sites-enabled
/default
(10) authorize {
(10) policy filter_username {
(10) if (&User-Name) {
(10) if (&User-Name) -> TRUE
(10) if (&User-Name) {
(10) if (&User-Name =~ / /) {
(10) if (&User-Name =~ / /) -> FALSE
(10) if (&User-Name =~ /#[^#]*#/ ) {
(10) if (&User-Name =~ /#[^#]*#/ ) -> FALSE
(10) if (&User-Name =~ /\.\./ ) {
(10) if (&User-Name =~ /\.\./ ) -> FALSE
(10) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) {
(10) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) ->
FALSE
(10) if (&User-Name =~ /\.$/) {
(10) if (&User-Name =~ /\.$/) -> FALSE
(10) if (&User-Name =~ /#\./) {
(10) if (&User-Name =~ /#\./) -> FALSE
(10) } # if (&User-Name) = notfound
(10) } # policy filter_username = notfound
(10) [preprocess] = ok
(10) [chap] = noop
(10) [mschap] = noop
(10) [digest] = noop
(10) suffix: Checking for suffix after "#"
(10) suffix: No '#' in User-Name = "guest123", looking up realm NULL
(10) suffix: No such realm "NULL"
(10) [suffix] = noop
(10) eap: Peer sent EAP Response (code 2) ID 12 length 43
(10) eap: Continuing tunnel setup
(10) [eap] = ok
(10) } # authorize = ok
(10) Found Auth-Type = eap
(10) # Executing group from file /etc/freeradius/sites-enabled/default
(10) authenticate {
(10) eap: Expiring EAP session with state 0xedb76556e4bb7c0e
(10) eap: Finished EAP session with state 0xedb76556e4bb7c0e
(10) eap: Previous EAP request found for state 0xedb76556e4bb7c0e, released
from the list
(10) eap: Peer sent packet with method EAP PEAP (25)
(10) eap: Calling submodule eap_peap to process data
(10) eap_peap: Continuing EAP-TLS
(10) eap_peap: [eaptls verify] = ok
(10) eap_peap: Done initial handshake
(10) eap_peap: [eaptls process] = ok
(10) eap_peap: Session established. Decoding tunneled attributes
(10) eap_peap: PEAP state send tlv success
(10) eap_peap: Received EAP-TLV response
(10) eap_peap: Success
(10) eap: Sending EAP Success (code 3) ID 12 length 4
(10) eap: Freeing handler
(10) [eap] = ok
(10) } # authenticate = ok
(10) # Executing section post-auth from file /etc/freeradius/sites-enabled
/default
(10) post-auth {
(10) update {
(10) No attributes updated
(10) } # update = noop
(10) sql: EXPAND .query
(10) sql: --> .query
(10) sql: Using query template 'query'
rlm_sql (sql): Reserved connection (4)
(10) sql: EXPAND %{User-Name}
(10) sql: --> guest123
(10) sql: SQL-User-Name set to 'guest123'
(10) sql: EXPAND INSERT INTO radpostauth (username, pass, reply, authdate)
VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}',
'%{reply:Packet-Type}', '%S')
(10) sql: --> INSERT INTO radpostauth (username, pass, reply, authdate)
VALUES ( 'guest123', ', 'Access-Accept', '2017-12-06 05:15:26')
(10) sql: Executing query: INSERT INTO radpostauth (username, pass, reply,
authdate) VALUES ( 'guest123', ', 'Access-Accept', '2017-12-06 05:15:26')
rlm_sql_postgresql: Status: PGRES_COMMAND_OK
rlm_sql_postgresql: query affected rows = 1
(10) sql: SQL query returned: success
(10) sql: 1 record(s) updated
rlm_sql (sql): Released connection (4)
(10) [sql] = ok
(10) [exec] = noop
(10) policy remove_reply_message_if_eap {
(10) if (&reply:EAP-Message && &reply:Reply-Message) {
(10) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE
(10) else {
(10) [noop] = noop
(10) } # else = noop
(10) } # policy remove_reply_message_if_eap = noop
(10) } # post-auth = ok
(10) Sent Access-Accept Id 52 from 192.168.18.249:1812 to
192.168.18.254:40607 length 0
(10) MS-MPPE-Recv-Key =
0xa5ded2c64f1026f75e105877bcc5715f3712051d16c7977a680fd50a2bd53352
(10) MS-MPPE-Send-Key =
0x5ccf08fba6d8803a9ac0478c8b02bd8c9ea5829c6c3d389410eed4f36fb06692
(10) EAP-Message = 0x030c0004
(10) Message-Authenticator = 0x00000000000000000000000000000000
(10) User-Name = "guest123"
(10) Finished request
Waking up in 4.8 seconds.
(0) Cleaning up request packet ID 42 with timestamp +29
(1) Cleaning up request packet ID 43 with timestamp +29
(2) Cleaning up request packet ID 44 with timestamp +29
(3) Cleaning up request packet ID 45 with timestamp +29
(4) Cleaning up request packet ID 46 with timestamp +29
(5) Cleaning up request packet ID 47 with timestamp +29
(6) Cleaning up request packet ID 48 with timestamp +29
(7) Cleaning up request packet ID 49 with timestamp +29
(8) Cleaning up request packet ID 50 with timestamp +29
(9) Cleaning up request packet ID 51 with timestamp +29
(10)) Cleaning up request packet ID 52 with timestamp +29
Ready to process requests
Expected result:
(Master1) # show user mac 44:39:c4:59:e5:64
Name: guest123, IP: 192.168.16.23, MAC: 44:39:c4:59:e5:64, Age: 00:00:05
Role: labguest (how: ROLE_DERIVATION_DOT1X_SDR)
Actual result:
(Master1) # show user mac 44:39:c4:59:e5:64
Name: guest123, IP: 192.168.16.23, MAC: 44:39:c4:59:e5:64, Age: 00:00:05
Role: authenticated (how: ROLE_DERIVATION_DOT1X)
I posted to the Aruba Airheads blog, and then opened a case with Aruba/HPE support. After analyzing logs and packet capture, the Aruba/HPE support engineer said,
"I would like to inform you that I went through the packet captures and I have attached the screenshots from the same based on what we observed;
As seen in the CP-Accept screenshot, we see the Radius Accept, for when the user was authenticating with Captive Portal. We see in the accept packet, that the server is sending the attribute 'labguest' to the controller for the user role to be assigned.
In the case of Dot1x-Accept screenshot, we do not see any attribute being sent by the server in the accept packet for when the user was authenticating with dot1x authentication.
Please check on the server end if we need to enable sending attribute for MSCHAPv2 along with the PAP protocol, or if there are any specific configurations on the server that are handling the attributes to be sent based on the authentication type."
I then posted to the FreeRADIUS user list. Response:
“The solution is to move the "files" module to before "eap". Edit sites-enabled/default. Look at the "authorize" section.”
That works. Excerpt of edited sites-enabled/default:
#
# This module takes care of EAP-MD5, EAP-TLS, and EAP-LEAP
# authentication.
#
# It also sets the EAP-Type attribute in the request
# attribute list to the EAP type from the packet.
#
# The EAP module returns "ok" or "updated" if it is not yet ready
# to authenticate the user. The configuration below checks for
# "ok", and stops processing the "authorize" section if so.
#
# Any LDAP and/or SQL servers will not be queried for the
# initial set of packets that go back and forth to set up
# TTLS or PEAP.
#
# The "updated" check is commented out for compatibility with
# previous versions of this configuration, but you may wish to
# uncomment it as well; this will further reduce the number of
# LDAP and/or SQL queries for TTLS or PEAP.
#
files
eap {
ok = return
# updated = return
}
#
# Pull crypt'd passwords from /etc/passwd or /etc/shadow,
# using the system API's to get the password. If you want
# to read /etc/passwd or /etc/shadow directly, see the
# mods-available/passwd module.
#
# unix
#
# Read the 'users' file. In v3, this is located in
# raddb/mods-config/files/authorize
# files
Tests from Aruba controller:
(Master1) #aaa test-server mschapv2 radius1 guest123 guest123 verbose
Authentication Successful
Processing time (ms) : 6.407
Attribute value pairs in request
--------------------------------
Vendor Attribute Value
------ --------- -----
NAS-IP-Address 192.168.18.254
NAS-Port-Id 0
NAS-Port-Type Wireless-IEEE802.11
User-Name guest123
Service-Type Login-User
Calling-Station-Id 0.0.0.0
Called-Station-Id 000B86BE91F0
Microsoft MS-CHAP-Challenge \032\241\007[\002(\\321j5\001v\221lf\236
Microsoft MS-CHAP2-Response
Aruba Aruba-Essid-Name
Aruba Aruba-Location-Id N/A
Aruba Aruba-AP-Group N/A
Aruba Aruba-Device-Type
Message-Auth I\365\262\357\365o{s\264\270\246\022Cz\264-
PW_RADIUS_ID H
Rad-Length 199
Attribute value pairs in response
---------------------------------
Vendor Attribute Value
------ --------- -----
Service-Type Framed-User
Filter-Id labguest
Microsoft MS-CHAP2-Success
Microsoft MS-MPPE-Recv-Key \205g8\374\333\260\031\306\3379\321\220\273\273\355\024\277\210Q\003\226\004M>\372\307p6\273&\322\231N\253
Microsoft MS-MPPE-Send-Key \215\277d\301f\207A\215!\376\345.\324\177BM\364\310\251p\263\224\315 \012\001\035:\327\253\314\016\026\243
Microsoft MS-MPPE-Encryption-Policy
Microsoft MS-MPPE-Encryption-Types
PW_RADIUS_ID H
Rad-Length 195
PW_RADIUS_CODE \002
PW_RAD_AUTHENTICATOR }\203!\353\244}\215,\216\203J]\027\247\325\272
(Master1) # show user mac fc:c2:de:13:d6:15
Name: guest123, IP: 192.168.16.3, MAC: fc:c2:de:13:d6:15, Age: 00:00:00
Role: labguest (how: ROLE_DERIVATION_DOT1X_SDR), ACL: 71/0
Authentication: Yes, status: successful, method: 802.1x, protocol: EAP-PEAP, server: radius1
Authentication Servers: dot1x authserver: radius1, mac authserver:
Bandwidth = No Limit
Bandwidth = No Limit
Role Derivation: ROLE_DERIVATION_DOT1X_SDR
VLAN Derivation: Default VLAN
Note that the edit to sites-enabled/default was after a clean FreeRADIUS install, not a correction to any monkeying.
In case this Attribute is set by a radius server to which the freeradius has to proxy, you have to modify the files:
mods-config/attr_filter/pre-proxy and post-proxy
adding among the attributes that you have to proxy also the:
Filter-Id =* ANY
I have a functionality wherein i have to upload a large number of records from a csv file. If any one of the records is invalid, no data should be uploaded. A csv file with errors against the invalid records needs to be sent to the user who uploaded the data. I am using rails (3.2), sidekiq (2.16.1) and mysql.
All the mails (devise and custom) mails are delivered and i receive them in my gmail inbox. The above functionality worked fine before being shifted to sidekiq.
User model
#works n gets delivered in inbox
Notifier.send_welcome_mail(self).deliver
Sidekiq Worker
class UploadWorker
include Sidekiq::Worker
sidekiq_options retry: false
def perform(user_id, inspection_id)
user = User.find(user_id)
inspection = Inspection.find(inspection_id)
err = false
#check if all data is valid and upload if valid
#
...
#shows in development log but doesnt get delivered in inbox.
Notifier.delay.upload_success(user, inspection) if err
Notifier.delay.upload_failed(user, inspection) unless err
end
end
development log
Sent mail to someone#gmail.com (142ms)
Date: Wed, 13 Nov 2013 17:24:25 +0530
To: someone#gmail.com
Message-ID: <5283687179a92_203f59f273e3#gmail.mail>
Subject: ["someone#gmail.com"] Upload failed
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
sidekiq log
2013-11-13T13:21:20Z 10064 TID-1n41gu UploadWorker JID-2d2c930601caf6a62c86e142 INFO: start
2013-11-13T13:22:13Z 10064 TID-1n41gu UploadWorker JID-2d2c930601caf6a62c86e142 INFO: done: 52.858 sec
2013-11-13T13:22:13Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-bcae8ea4974ecfe280e411bd INFO: start
2013-11-13T13:22:14Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-bcae8ea4974ecfe280e411bd INFO: done: 0.858 sec
2013-11-13T13:23:51Z 10064 TID-1n41gu UploadWorker JID-03fe3dee40f6390f5cec1d93 INFO: start
2013-11-13T13:23:54Z 10064 TID-1n41gu UploadWorker JID-03fe3dee40f6390f5cec1d93 INFO: done: 2.779 sec
2013-11-13T13:23:54Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-44f75877c5919302c9ded4fe INFO: start
2013-11-13T13:23:54Z 10064 TID-1w7iwu Sidekiq::Extensions::DelayedMailer JID-44f75877c5919302c9ded4fe INFO: done: 0.038 sec
The issue is, only the mails from sidekiq are shown as sent in log but arent delivered. Other mails from devise n custom mail do get delivered.
Are you sure your development email settings are set correctly? Try setting the following in config/development.rb:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
:address => '127.0.0.1',
:port => '587',
}
Im having a problem when I deploy a feature. The feature contains three bundles, and Karaf deploys well these bundles, but when they are deployed ActiveMQ starts to having problems.
The deployed bundles are simples. The "complicated" is a camel route who expose a CXF endpoint and call a endpoint mock. I just attached to this threar the .kar, the zip of that kar and my fuse log. The service is running, but the problem with activeMQ happend always
The error is always the same:
2013-05-14 15:19:48,046 | INFO | veMQ Broker: amq | ActiveMQServiceFactory$$anon$1 | ? ? | 106 - org.springframework.context - 3.1.3.RELEASE | Refreshing org.fusesource.mq.fabric.ActiveMQServiceFactory$$anon$1#33c91e: startup date [Tue May 14 15:19:48 ART 2013]; root of context hierarchy
2013-05-14 15:19:48,048 | INFO | veMQ Broker: amq | XBeanXmlBeanDefinitionReader | ? ? | 105 - org.springframework.beans - 3.1.3.RELEASE | Loading XML bean definitions from file [/home/ramiro/tecPlata/jboss-fuse-6.0.0.redhat-024/etc/activemq.xml]
2013-05-14 15:19:48,095 | INFO | veMQ Broker: amq | DefaultListableBeanFactory | ? ? | 105 - org.springframework.beans - 3.1.3.RELEASE | Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#1885c3a: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.apache.activemq.xbean.XBeanBrokerService#0]; root of factory hierarchy
2013-05-14 15:19:48,159 | INFO | veMQ Broker: amq | PListStoreImpl | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | PListStore:[/home/ramiro/tecPlata/jboss-fuse-6.0.0.redhat-024/data/amq/amq/tmp_storage] started
2013-05-14 15:19:48,163 | ERROR | veMQ Broker: amq | BrokerService | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Failed to start Apache ActiveMQ (amq, null). Reason: javax.management.InstanceAlreadyExistsException: org.apache.activemq:type=Broker,brokerName=amq
javax.management.InstanceAlreadyExistsException: org.apache.activemq:type=Broker,brokerName=amq
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)[:1.6.0_30]
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)[:1.6.0_30]
at org.apache.activemq.broker.jmx.ManagementContext.registerMBean(ManagementContext.java:380)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.apache.activemq.broker.jmx.AnnotatedMBean.registerMBean(AnnotatedMBean.java:72)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.apache.activemq.broker.BrokerService.startManagementContext(BrokerService.java:2337)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:543)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.fusesource.mq.fabric.ActiveMQServiceFactory$ClusteredConfiguration$$anon$3.run(ActiveMQServiceFactory.scala:307)[128:org.jboss.amq.mq-fabric:6.0.0.redhat-024]
2013-05-14 15:19:48,164 | INFO | veMQ Broker: amq | BrokerService | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Apache ActiveMQ 5.8.0.redhat-60024 (amq, null) is shutting down
2013-05-14 15:19:48,168 | INFO | veMQ Broker: amq | TransportConnector | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Connector openwire Stopped
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | PListStoreImpl | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | PListStore:[/home/ramiro/tecPlata/jboss-fuse-6.0.0.redhat-024/data/amq/amq/tmp_storage] stopped
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | KahaDBStore | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Stopping async queue tasks
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | KahaDBStore | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Stopping async topic tasks
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | KahaDBStore | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Stopped KahaDB
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | BrokerService | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Apache ActiveMQ 5.8.0.redhat-60024 (amq, null) uptime 0.010 seconds
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | BrokerService | ? ? | 114 - org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Apache ActiveMQ 5.8.0.redhat-60024 (amq, null) is shutdown
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | ActiveMQServiceFactory | ? ? | 128 - org.jboss.amq.mq-fabric - 6.0.0.redhat-024 | Broker amq failed to start. Will try again in 10 seconds
2013-05-14 15:19:48,169 | INFO | veMQ Broker: amq | ActiveMQServiceFactory | ? ? | 128 - org.jboss.amq.mq-fabric - 6.0.0.redhat-024 | Exception on start: javax.management.InstanceAlreadyExistsException: org.apache.activemq:type=Broker,brokerName=amq
javax.management.InstanceAlreadyExistsException: org.apache.activemq:type=Broker,brokerName=amq
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)[:1.6.0_30]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)[:1.6.0_30]
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)[:1.6.0_30]
at org.apache.activemq.broker.jmx.ManagementContext.registerMBean(ManagementContext.java:380)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.apache.activemq.broker.jmx.AnnotatedMBean.registerMBean(AnnotatedMBean.java:72)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.apache.activemq.broker.BrokerService.startManagementContext(BrokerService.java:2337)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:543)[114:org.apache.activemq.activemq-osgi:5.8.0.redhat-60024]
at org.fusesource.mq.fabric.ActiveMQServiceFactory$ClusteredConfiguration$$anon$3.run(ActiveMQServiceFactory.scala:307)[128:org.jboss.amq.mq-fabric:6.0.0.redhat-024]
Dropbox URL to Fuse LOG https://dl.dropboxusercontent.com/u/225304/fuse.log
Dropbox URL to .kar file https://dl.dropboxusercontent.com/u/225304/PruebaFeature-1.0-SNAPSHOT.kar
This example I used a clean Fuse. Any ideas of what is happening? i dont know if the problem is the configuration of ActiveMQ, or anything else.
This is what i recive when I list activemq in Karaf
This is when I list the broker in karaf
JBossFuse:karaf#root> activemq:query --jmxlocal
Name = KahaDBPersistenceAdapter[/home/ramiro/tecPlata/jboss-fuse-6.0.0.redhat-024/data/amq/kahadb]
brokerName = amq
Transactions = []
Size = 13411
InstanceName = KahaDBPersistenceAdapter[/home/ramiro/tecPlata/jboss-fuse-6.0.0.redhat-024/data/amq/kahadb]
Data = [1]
type = Broker
Service = PersistenceAdapter
brokerName = amq
service = Health
CurrentStatus = Good
type = Broker
brokerName = amq
connector = clientConnectors
type = Broker
StatisticsEnabled = true
connectorName = openwire
destinationName = ActiveMQ.Advisory.MasterBroker
MemoryUsageByteCount = 0
DequeueCount = 0
type = Broker
destinationType = Topic
Name = ActiveMQ.Advisory.MasterBroker
MinEnqueueTime = 0
MaxAuditDepth = 2048
AverageEnqueueTime = 0.0
InFlightCount = 0
MemoryLimit = 67108864
brokerName = amq
EnqueueCount = 1
MaxEnqueueTime = 0
MemoryUsagePortion = 1.0
ProducerCount = 0
UseCache = true
BlockedProducerWarningInterval = 30000
AlwaysRetroactive = false
Options =
MaxProducersToAudit = 64
PrioritizedMessages = false
ConsumerCount = 0
ProducerFlowControl = true
Subscriptions = []
QueueSize = 0
MaxPageSize = 200
DispatchCount = 0
MemoryPercentUsage = 0
ExpiredCount = 0
TopicSubscribers = []
TemporaryQueues = []
Uptime = 1 minute
TemporaryTopicSubscribers = []
MemoryPercentUsage = 0
BrokerVersion = 5.8.0.redhat-60024
StatisticsEnabled = true
TotalDequeueCount = 0
TopicProducers = []
QueueSubscribers = []
Topics = [org.apache.activemq:type=Broker,brokerName=amq,destinationType=Topic,destinationName=ActiveMQ.Advisory.MasterBroker]
TotalMessageCount = 0
SslURL =
TemporaryQueueSubscribers = []
BrokerName = amq
DynamicDestinationProducers = []
Persistent = true
DataDirectory = /home/ramiro/tecPlata/jboss-fuse-6.0.0.redhat-024/data/amq
Queues = []
DurableTopicSubscribers = []
TotalConsumerCount = 0
InactiveDurableTopicSubscribers = []
JobSchedulerStoreLimit = 0
TempPercentUsage = 0
MemoryLimit = 67108864
VMURL = vm://amq
OpenWireURL = tcp://fluxit-ntb-43:61616?maximumConnections=1000
JobSchedulerStorePercentUsage = 0
TotalEnqueueCount = 1
TemporaryQueueProducers = []
StompSslURL =
TemporaryTopics = []
StompURL =
Slave = false
BrokerId = ID:fluxit-ntb-43-58596-1368558172573-0:1
TotalProducerCount = 0
StorePercentUsage = 0
brokerName = amq
StoreLimit = 107374182400
TransportConnectors = {openwire=tcp://fluxit-ntb-43:61616?maximumConnections=1000}
TemporaryTopicProducers = []
TempLimit = 53687091200
QueueProducers = []
type = Broker
The features.xml in your kar is incorrect which cause this error. It has some bundle like
<bundle>mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4</bundle>
<bundle>mvn:org.apache.aries/org.apache.aries.util/1.0.0</bundle>
<bundle>mvn:org.apache.aries.proxy/org.apache.aries.proxy.api/1.0.0</bundle>
<bundle>mvn:org.apache.aries.blueprint/org.apache.aries.blueprint/1.0.1.redhat-60024</bundle>
Those bundles are very fundamental for the container and already get installed by container by default.
It shouldn't be in your features.xml, or if they're there, you should have
resolver="(obr)" for feature and dependency="true" for those bundle so that OBR resolver can kick in to prevent install redundant bundles.
Moreover, the
<bundle>mvn:org.apache.aries.blueprint/org.apache.aries.blueprint/1.0.1.redhat-60024</bundle>
is invalid for aries.blueprint 1.0.x, it should be
<bundle dependency="true" start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.api/1.0.1.redhat-60024</bundle>
<bundle dependency="true" start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.0.1.redhat-60024</bundle>
<bundle dependency="true" start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.0.1.redhat-60024</bundle>
instead. Otherwise you will see errors like
ERROR: Bundle org.apache.aries.blueprint [251] EventDispatcher: Error during dispatch. (java.lang.ClassCastException: org.apache.aries.blueprint.ext.impl.ExtNamespaceHandler cannot be cast to org.apache.aries.blueprint.NamespaceHandler)
java.lang.ClassCastException: org.apache.aries.blueprint.ext.impl.ExtNamespaceHandler cannot be cast to org.apache.aries.blueprint.NamespaceHandler
This means you have two conflict aries.blueprint bundle installed in your container which messed up almost everything.
In a summary, change your features.xml in your kar like
<?xml version="1.0" encoding="UTF-8"?>
<features>
<feature name='tosMock' version='1.0.0-SNAPSHOT'>
<bundle>mvn:com.tecplata.esb.services/tosMock/1.0.0-SNAPSHOT</bundle>
</feature>
<feature name='esb-entities' version='1.0.0-SNAPSHOT'>
<bundle>mvn:com.tecplata.esb/esb-entities/1.0.0-SNAPSHOT</bundle>
</feature>
<feature name='vesselsService-sei' version='1.0.0-SNAPSHOT'>
<feature version='1.0.0-SNAPSHOT'>esb-entities</feature>
<bundle>mvn:com.tecplata.esb.services.sei/vesselsService-sei/1.0.0-SNAPSHOT</bundle>
</feature>
<feature name='vesselsVisitorService' version='1.0.0-SNAPSHOT'>
<bundle>mvn:org.apache.camel/camel-core/2.10.0.redhat-60024</bundle>
<feature version='1.0.0-SNAPSHOT'>vesselsService-sei</feature>
<bundle>mvn:com.tecplata.esb.services/vesselsVisitorService/1.0.0-SNAPSHOT</bundle>
</feature>
</features>
can make it work.
Freeman
The user has cross posted the same questions in many places. When you do this please tell us, as the conversation is the scattered.
Being active discussed here:
http://fusesource.com/forums/thread.jspa?threadID=4797&tstart=0
But also posted here:
https://community.jboss.org/thread/228200
I am trying to send mail using sendmail settings but i am not receiving the mail I can see the mail sent in development log.
config/application.rb
config.action_mailer.delivery_method = :sendmail
config.action_mailer.sendmail_settings = {
:location => '/usr/sbin/sendmail',
:arguments => '-i -t'
}
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
mailers/Notifier.rb
class Notifier < ActionMailer::Base
default :from => "deepika#xxx.com"
def welcome_email
mail(:to => "deepika#xxx.com", :subject => "Welcome to My Site test mail")
end
end
And i am calling Notifier.welcome_email.deliver from index method.
I can see log
Sent mail to deepika#xxx.com (339ms)
Date: Wed, 10 Apr 2013 15:16:33 +0530
From: deepika#xxx.com
To: deepika#xxx.com
Message-ID: <516534f983356_30f3262c7c84610d2#cybage-virtual-machine.mail>
Subject: Welcome to My Site test mail
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Thanks for joining and have a great day!</p>
But i am not receiving mail.
when i do service sendmail status i am getting
MSP: is run via cron (20m)
MTA: 123995 /usr/sbin/sendmail-mta -Am -L sm-mta -bd -q10m
UID PID PPID C STIME TTY TIME CMD
root 123995 1 0 15:36 ? 00:00:00 sendmail: MTA: accepting connections
Daemon Status: (process 132996) Queue runner
Current number of children: 1
QueueDir free disk space (in blocks): 285222800
Load average: 1
Child Process 139595 Status: accepting connections
Child Process 144035 Status: console socket child
QUE: Same as MTA
Also when i do vi /var/mail/root, I am getting following
This is a MIME-encapsulated message
--r3A9kDux012954.1365587178/cybage-virtual-machine.cybage.com
The original message was received at Wed, 10 Apr 2013 15:02:21 +0530
from localhost
with id r3Adsdsd9WLU5012559
----- The following addresses had permanent fatal errors -----
<deepika#xxx.com>
(reason: Client was not authenticated)
----- Transcript of session follows -----
... while talking to mail.xxx.com.:
>>> MAIL From:<> SIZE=268814
<<< 530 5.7.1 Client was not authenticated
Service unavailable
Can you please tell me what is the reason behind not receiving mail.