Errors with RabbitMQ on FreeBSD

I’ve run into the following error(s) intermittently while starting or stopping RabbitMQ on my FreeBSD machine. It was rather perplexing as it seemed inconsistent.

The messages have been abbreviated for brevity.

$ sudo /usr/local/etc/rc.d/rabbitmq start
{error_logger,{{2009,10,14},{9,8,46}},std_error,"File operation error: eacces. Target: .. Function: read_file_info. Process: code_server."}
{error_logger,{{2009,10,14},{9,8,46}},std_error,"File operation error: eacces. Target: ./standard_error.beam. Function: get_file. Process: code_server."}
{error_logger,{{2009,10,14},{9,8,46}},std_error,"File operation error: eacces. Target: ./supervisor_bridge.beam. Function: get_file. Process: code_server."}
{error_logger,{{2009,10,14},{9,8,46}},std_error,"File operation error: eacces. Target: ./user_sup.beam. Function: get_file. Process: code_server."}
{error_logger,{{2009,10,14},{9,8,46}},std_error,"File operation error: eacces. Target: ./user.beam. Function: get_file. Process: code_server."}
{error_logger,{{2009,10,14},{9,8,46}},std_error,"File operation error: eacces. Target: ./kernel_config.beam. Function: get_file. Process: code_server."}
{error_logger,{{2009,10,14},{9,8,46}},std_error,"File operation error: eacces. Target: ./queue.beam. Function: get_file. Process: code_server."}

...

=ERROR REPORT==== 14-Oct-2009::09:08:46 ===
file:path_eval([".","/var/db/rabbitmq"],".erlang"): permission denied
Starting all nodes...
Starting node rabbit@localhost...

=ERROR REPORT==== 14-Oct-2009::09:08:46 ===
File operation error: eacces. Target: ./inet_gethost_native.beam. Function: get_file. Process: code_server.

=ERROR REPORT==== 14-Oct-2009::09:08:46 ===
File operation error: eacces. Target: ./dist_util.beam. Function: get_file. Process: code_server.

=ERROR REPORT==== 14-Oct-2009::09:08:46 ===
File operation error: eacces. Target: ./proplists.beam. Function: get_file. Process: code_server.
({"init terminating in do_boot",{badarg,[{erl_prim_loader,check_file_result,3},{erl_prim_loader,check_file_result,3},{init,get_boot,1},{init,get_boot,2},{init,do_boot,3}]}}
no error logger present) error: "Error in process <0.1.0> with exit value: {badarg,[{erl_prim_loader,check_file_result,3},{erl_prim_loader,check_file_result,3},{init,get_boot,1},{init,get_boot,2},{init,do_boot,3}]}\n"

=ERROR REPORT==== 14-Oct-2009::09:08:47 ===
File operation error: eacces. Target: ./erl_scan.beam. Function: get_file. Process: code_server.
init terminating in do_boot ()
Error: {node_start_failed,normal}

Not being familiar with Erlang, or RabbitMQ for that matter, these messages seemed meaningless. Following various links on Google suggested privilege issues, others suggested running strace to help pin point the problem.
Continue reading

Posted in Answers, FreeBSD | Leave a comment

How do I determine the expiration date of a p12 certificate?

First you will need to translate the pkcs12 certificate into a PEM certificate.
The PEM certificate is only needed temporarily and can later be removed.

$ openssl pkcs12 -in certificate.p12 -out tempcrt.pem
Enter Import Password: 
MAC verified OK
Enter PEM pass phrase: 
Verifying - Enter PEM pass phrase:

 

Now, we use the tempcrt.pem that we generated to determine the expiration date. The first method, which only displays the expiration date can be retrieved like this:

$ openssl x509 -in tempcrt.pem -noout -enddate
notAfter=Jan  3 23:19:24 2009 GMT

 

The second method which includes a lot more detail about the certificate below, I’ve only included the details relevant to the creation and expiration dates.

$ openssl x509 -in tempcrt.pem -noout -text
        [ ... snip ... ]
        Validity
            Not Before: Jan  3 23:19:24 2008 GMT
            Not After : Jan  3 23:19:24 2009 GMT
        [ ... snip ... ]

 

Posted in Answers, Security, System Administration | 4 Comments

Fixing PCRE_UTF8 Errors in FreeBSD

I have recently encountered this error:
PHP Warning: preg_match(): Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0

And despite some of the suggested solutions I have found in various Drupal and MediaWiki forums, all of them related to older versions of ports.
The version of pcre I have installed is 7.8. as seen here:

PCRE version 7.8 2008-09-05
Compiled with
  UTF-8 support
  Unicode properties support
  Newline sequence is LF
  \R matches all Unicode newlines
  Internal link size = 2
  POSIX malloc threshold = 10
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack

But the curious thing is phpinfo(), told a different story.
Continue reading

Posted in FreeBSD, Programming, System Administration | 12 Comments