Redmine don't send e-mail, execution expired error - redmine

I'm having problems using email in redmine. This is my redmine Environment versions:
Environment:
Redmine version 2.4.2.stable
Ruby version 1.9.3-p484 (2013-11-22) [x86_64-linux]
Rails version 3.2.16
Environment production
Database adapter MySQL
SCM:
Git 1.9.1
Filesystem
Redmine plugins:
no plugin installed
I configured the configuration.yml file like this:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: "smtp.office365.com"
port: 587
domain: "mydomain.com.br"
authentication: :login
user_name: "user#mydomain.com.br"
password: "mypassword"
attachments_storage_path: /home/redmin/Downloads/redmine-2.3.2/files
autologin_cookie_name:
autologin_cookie_path:
autologin_cookie_secure:
scm_subversion_command: svn
scm_mercurial_command:
scm_git_command: /usr/bin/git
scm_cvs_command:
scm_bazaar_command:
scm_darcs_command:
scm_stderr_log_file:
database_cipher_key:
rmagick_font_path:
So, i access redmine in browser and click in button "Send Test Email" but i got the following error: execution expired after a lot of time loading page.
In my production.log file i got a success message without any error, but e-mail never arrive:
Sent email "Redmine test" (30215ms)
to: target#gmail.com
Edit 1:
If i change the devlivery_method to ":sendmail" the test works but email never arrives.

Related

WSO2 Analytics Hostname

API Manager 3.0.0 and Analytics 3.0.0
Actually API-M I changed to hostname with any problems. When I change to hostname of Analytics some erros to login:
Only I change in [API-Analytics]/conf/dashboard/deployment.yaml
deployment.yaml
## Authentication configuration
auth.configs:
type: apim
ssoEnabled: true
properties:
adminScope: apim_analytics:admin_carbon.super
allScopes: apim_analytics:admin apim_analytics:product_manager apim_analytics:api_developer apim_analytics:app_developer apim_analytics:devops_engineer apim_analytics:analytics_viewer apim_analytics:$
adminServiceBaseUrl: https://myhostname:9443
adminUsername: admin
adminPassword: admin
kmDcrUrl: https://myhostname:9443/client-registration/v0.15/register
kmTokenUrlForRedirection: https://myhostname:9443/oauth2
kmTokenUrl: https://hostname:9443/oauth2
kmUsername: admin
kmPassword: admin
portalAppContext: analytics-dashboard
businessRulesAppContext : business-rules
cacheTimeout: 900
baseUrl: https://myhostname:9643
grantType: authorization_code
publisherUrl: https://myhostname:9443
#storeUrl: https://myhostname:9443
If I have this error in terminal, after to start dashboard server.
<ip adress> != <localhost>
But I change myhostname to localhost no sends this errors but in login page of Dashboard sends:
https://localhost:9443/oauth2/authorize?response_type=code&client_id=VACHtG8hNxzG2au1EcA3sNmmXooa&scope=apim_analytics%3Aadmin%20apim_analytics%3Aproduct_manager%20apim_analytics%3Aapi_developer%20apim_analytics%3Aapp_developer%20apim_analytics%3Adevops_engineer%20apim_analytics%3Aanalytics_viewer%20apim_analytics%3Aeveryone%20openid%20apim%3Aapi_view%20apim%3Asubscribe&redirect_uri=https%3A%2F%2Flocalhost%3A9643%2Flogin%2Fcallback%2Fanalytics-dashboard%2Flogin
So, how fix or changed hostanem correctly?
Edit:
I change only kmTokenUrlForRedirection,kmTokenUrl and baseUrl from deplymento.yaml and dashboard page I have:
I search the error and found this link https://apim.docs.wso2.com/en/latest/troubleshooting/troubleshooting-invalid-callback-error/
But I try put somo regexp similar to:
regexp
regexp=(https://myhostname:9643/analytics-dashboard/login|https://myhostname:6443/analytics-dashboard/logout)
But nothing.
My new question is:
Where is a correct form of regexp of dashboard?
Change your analytics_dashboard sp's regex to following and try.
regexp=(https://myhostname:9643/login/callback/analytics-dashboard/login|https://myhostname:9643/analytics-dashboard)

Unable to authenticate iRedmail Ldap mail accounts with Redmine application

I have two different servers for iRedMail and Redmine applications. iRedMail is using OpenLDAP internally to create email accounts.
I would like to authenticate Redmine application with iRedMail OpenLDAP mail accounts.
I have done the below LDAP settings but Login fails in Redmine application when i try to login with iRedMail email and password and displays a message as "Invalid UserId and Password"
iRedMail LDAP skeleton
dc=example,dc=com
-- o=domains
---- domainName=example.com
------ ou=Users
---------mail=testuser1#example.com
---------mail=testuser2#example.com
DN for testuser1: mail=testuser1#example.com,ou=Users,domainName=example.com,o=domains,dc=example,dc=com
DN for testuser2: mail=testuser2#example.com,ou=Users,domainName=example.com,o=domains,dc=example,dc=com
Redmine application LDAP configuration
Name - LdapRedMail
Host - IpAddress
Port - 389
LDAPS - No
Account - cn=Manager,dc=example,dc=com
Password - ******
Base DN - domainName=example.com,o=domains,dc=example,dc=com
LDAP filter - (&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=inetOrgPerson)(objectClass=mailUser)))
Attributes
Login attribute - mail
Firstname attribute - givenName
Lastname attribute - sN
Email attribute - mail
So would anyone help to resolve this issue?
After long search, i am able resolve the issue as shown below,
Name - LdapRedMail
Host - IpAddress
Port - 389
LDAPS - No
Account - cn=vmail,dc=example,dc=com
Password - <vmail password from settings.py>
Base DN - o=domains,dc=example,dc=com
LDAP filter - <empty>

Mailgun 404 error with Pythonanywhere

I'm trying to use mailgun in my Django project hosted on Pythonanywhere.
In my WSGI file, I have:
os.environ['DJANGO_MAILGUN_SERVER_NAME'] = 'https://api.mailgun.net/v3/sandboxnumbersomething.mailgun.org/messages'
os.environ['DJANGO_MAILGUN_API_KEY'] ='mykey'
and my settings are:
# EMAIL
# ------------------------------------------------------------------------------
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
default='Apitrak <noreply#apitrak.com>')
EMAIL_BACKEND = 'django_mailgun.MailgunBackend'
MAILGUN_ACCESS_KEY = env('DJANGO_MAILGUN_API_KEY')
MAILGUN_SERVER_NAME = env('DJANGO_MAILGUN_SERVER_NAME')
When my app fire an email (for example at signup), I have a 404 error:
MailgunAPIError at /accounts/email/
<Response [404]>
Request Method: POST
Request URL: https://vincentle.pythonanywhere.com/accounts/email/
Django Version: 1.8.6
Exception Type: MailgunAPIError
Exception Value:
<Response [404]>
Exception Location: /home/vincentle/.virtualenvs/apitrak/lib/python3.4/site-packages/django_mailgun.py in _send, line 154
Python Executable: /usr/local/bin/uwsgi
Python Version: 3.4.0
Python Path:
['/var/www',
'.',
'',
'/var/www',
'/home/vincentle/.virtualenvs/apitrak/lib/python3.4',
'/home/vincentle/.virtualenvs/apitrak/lib/python3.4/plat-x86_64-linux-gnu',
'/home/vincentle/.virtualenvs/apitrak/lib/python3.4/lib-dynload',
'/usr/lib/python3.4',
'/usr/lib/python3.4/plat-x86_64-linux-gnu',
'/home/vincentle/.virtualenvs/apitrak/lib/python3.4/site-packages',
'/home/vincentle/apitrak']
Server time: Tue, 17 Nov 2015 16:02:28 +0100
I've tried a curl in the virtualenv of my WebApp:
curl -s --user 'api:key-NUMBERS' https://api.mailgun.net/v3/NUMBERS.mailgun.org/messages -F from='Excited User <excited#samples.mailgun.org>' -F to='vincent#vincentle.fr' -F subject='Hello' -F text='Testing some Mailgun awesomeness!'
And this works OK.
The setting DJANGO_MAILGUN_SERVER_NAME should be a domain name, not a url.
Try the following:
os.environ['DJANGO_MAILGUN_SERVER_NAME'] = '<sandboxnumbersomething>.mailgun.org'
From the readme:
Replace SERVER-NAME with the last part of your "API Base URL" (e.g. https://api.mailgun.net/v3/<your_server_name>), also found in your Mailgun account details.

Rails 4: How to add ENVIRONMENT VARIABLES on Ubuntu 14.04 using RVM?

Right now I'm trying to deploy my Ruby on Rails app to a Virtual Machine on Windows Azure running Ubuntu but I can fix de set environment variables error as below describe.
I have done added variables to my .bashrc and now in /etc/environment but the error is the same:
App 1227 stderr: [ 2015-10-06 04:10:57.3814 1352/0x9020d38(Worker 1) utils.rb:86 ]: *** Exception RuntimeError in Rack application object (Missing `secret_to$
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:534:in `validate_secret_$
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:246:in `env_config'
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:514:in `call'
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:165:in `call'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:94:in `process_request'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:151:in `accept_and_process_next_request'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:112:in `main_loop'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:112:in `block in create_thread_and_abort_on_exception'
[ 2015-10-06 04:10:57.3819 988/b5efeb40 age/Cor/Req/Utils.cpp:95 ]: [Client 1-1] Sending 502 response: application did not send a complete response
This is my sudo nano /etc/environment file:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
export SECRET_KEY_BASE=2da0d3f0bfd7b9b05110bfad512f42df2d2bb2ef715c4e831caba96a9c0b2141fbfa718dff2f5daf916cd70a70afd1f24df49884c561fbbaf364b36652b2c7d1
ruby -e 'p ENV["SECRET_KEY_BASE"]'
export MATCH_PEOPLE_DATABASE_PASSWORD=2015deployer
ruby -e 'p ENV["MATCH_PEOPLE_DATABASE_PASSWORD"]'
And when I run echo $SECRET_KEY_BASE or echo $MATCH_PEOPLE_DATABASE_PASSWORD I got the exact data.
deploy#vmw-ubuserver:~$ echo $SECRET_KEY_BASE
2da0d3f0bfd7b9b05110bfad512f42df2d2bb2ef715c4e831caba96a9c0b2141fbfa718dff2f5daf916cd70a70afd1f24df49884c561fbbaf364b36652b2c7d1
deploy#vmw-ubuserver:~$ echo $MATCH_PEOPLE_DATABASE_PASSWORD
2015deployer
But I still getting the same error in production, I'm using RVM, Capistrano, Passenger and NGINX on Ubuntu 14.04.
My database.yml :
production:
adapter: mysql2
encoding: utf8
pool: 5
host: localhost
database: matchpeople_production
username: deployer
password: <%= ENV['MATCH_PEOPLE_DATABASE_PASSWORD'] %>
My secrets.yml :
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
secret_token: <%= ENV["SECRET_KEY_BASE"] %>
Any kind of help?
Looking and looking for the correct answer I have been trying too many options but I didn't make it works fine.
So, suddenly I found I solution while I was testing some configurations found on google.
It is simple, just:
Add the next lines:
export SECRET_KEY_BASE=3aa7e349bh345h245hi23452345h234ih52i3u45h$
export MATCH_PEOPLE_DATABASE_PASSWORD=your_pass_here
# Uncomment these lines and restart the server to validate if the variables are read correctly
#ruby -e 'p ENV["SECRET_KEY_BASE"]'
#ruby -e 'p ENV["MATCH_PEOPLE_DATABASE_PASSWORD"]'
At the end of the files below:
sudo nano ~/.bash_profile
sudo nano /etc/environment
If you want you can uncomment the last two lines in ~/.bash_profile and restart your server and when you login to it again, you will see the value of the ENVIRONMENT VARIABLES before your promt as in the picture below.
I recommend you to keep those lines commented do it just for validate and then comment them again.
If you have any question, please leave a comment!
Hope it could be useful.
From my experience, there is no secret_token needed in secrets.yml for Ruby RVM.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
I think to solve the problem, remove the second line from your production: section
In case you need to add environment variables to RVM, edit
# /etc/profile.d/appspecific.sh
add something like
export GEM_PATH=/usr/local/rvm/gems/ruby-1.9.3-p551:/usr/local/rvm/gems/ruby-1.9.3-p551#global
export GEM_HOME=/usr/local/rvm/gems/ruby-1.9.3-p551
Good luck!

Octopus gem is sending 2 SQL queries for every ActiveRecord query

Currently I have a "State" model and following config details in shards.yml.
I am checking the following in "development" environment.
octopus:
environments:
- development
- staging
- production
replicated: true
fully_replicated: true
development:
slave1:
host: 192.168.5.130
adapter: mysql2
database: mydb
username: user
password: Password
reconnect: false
staging:
slave1:
host: 192.168.1.2
adapter: mysql2
database: server_db
username: admin
password: fake_staging_password
reconnect: false
production:
slave1:
host: 192.168.1.5
adapter: mysql2
database: production_db_name
username: admin
password: fake_production_password
reconnect: true
When ever I issue State.all or any active record query, I see the same SQL statment is sent to server 2 times
For example State.count sends the following SQL two times.
[Shard: slave1] (1.5ms) SELECT COUNT(*) FROM `states`
[Shard: slave1] (2.1ms) SELECT COUNT(*) FROM `states`
=> 35
Is this normal? or I have any issue in settings?
I think you're supposed to place either replicated: true or fully_replicated: true
Not both.