Newsletter function

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/31/2009 5:48:03 AM
Gravatar
Total Posts 20

Newsletter function

Hi,

I'm having trouble with the newsletter function.

The newsletter is just not send. It just stays in the task queue.

Any ideas?

 

Jacob :o)



Here's what the log says:

2009-10-31 11:36:13,015 INFO mojoPortal.Web.Global - Global.asax.cs Application_End

2009-10-31 11:36:18,328 INFO mojoPortal.Web.Global - Application Started.

2009-10-31 11:36:19,453 INFO mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task

2009-10-31 11:36:19,468 INFO mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread

2009-10-31 11:37:35,234 INFO mojoPortal.Web.LetterSendTask - deserialized LetterSendTask task

2009-10-31 11:37:35,234 INFO mojoPortal.Web.LetterSendTask - Queued LetterSendTask on a new thread

2009-10-31 11:39:22,046 INFO mojoPortal.Web.Global - Application Started.

2009-10-31 11:39:23,078 INFO mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task

2009-10-31 11:39:23,078 INFO mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread



Here's the task queue:

Task Name

Queued

Started

Last Update

Progress

Status

WebTaskManager

10/31/2009 11:43:58 AM

10/31/2009 11:43:59 AM

10/31/2009 11:44:00 AM

50%

Running

Herreski 2010 Mailer

10/31/2009 10:52:53 AM

10/31/2009 11:42:54 AM

10/31/2009 11:42:54 AM

0%

Started


10/31/2009 5:50:34 AM
Gravatar
Total Posts 20

Re: Newsletter function

Btw. Recover Password works fine.

And in web.config it states: <add key="DisableDotNetOpenMail" value="true" />

 

11/1/2009 6:43:25 AM
Gravatar
Total Posts 18439

Re: Newsletter function

Hi,

What version of mojoPortal are you using?

I've recently been working on major newsletter improvements for the coming release. If you are using MS SQL, you could get a preview release from our Novell Forge download page, mojoportal-mssql-build-2009-10-31.zip. It has all the newsletter improvements.

You can upgrade to this build and you will still be able to upgrade to the final release. I am running this build on this site and on demo.mojoportal.com.

Note that the newsletter task and most tasks sleep a few seconds before they start doing their work. We now have a progress bar to show you progress of sending the newsletter. Also make sure there is at least one subscriber to the newsletter.

Hope it helps,

Joe

11/1/2009 6:46:11 AM
Gravatar
Total Posts 18439

Re: Newsletter function

Make sure also that you have a valid email address in Administration > Site Settings in the Site Email From Address, probably this should be the same as what you have in smtp settings.

Hope it helps,

Joe

11/1/2009 10:53:11 AM
Gravatar
Total Posts 20

Re: Newsletter function

Hi Joe,

Thank you for your response.

I'm using v.2.3.1.9 MySQL.

These are my settings from web.config: 

<add key="DisableDotNetOpenMail" value="false" />
<add key="SMTPServer" value="smtp.unoeuro.com" />
<add key="SMTPRequiresAuthentication" value="false" />
<add key="SMTPUseSsl" value="false" />
<add key="SMTPPort" value="25" />
<add key="SMTPUser" value="" />
<add key="SMTPPassword" value="" />
<add key="SMTPTimeoutInMilliseconds" value="30000" />
<!-- leave this blank for ascii encoding -->
<add key="SmtpPreferredEncoding" value="" />

<smtp from="herreski@culmsee.dk">
<network host="smtp.unoeuro.com" port="25" password="" userName="" />

The mailer task is still at 0%.

br. Jacob :o)

 

11/1/2009 12:13:59 PM
Gravatar
Total Posts 18439

Re: Newsletter function

I would check the logs under Administration > System Log to see if any related errors are being logged.

Note that password recovery uses different settings than mojoportal features, it comes from the system.net.mail section in Web.config whereas mojoPortal features use appSettings.

I would try to get the contact form working, if it works then the newsletter should work, but its easier to troubleshoot and test with contact form. Don't forget to add an address in the settings of the contact form where to send messages.

http://www.mojoportal.com/emailconfiguration.aspx

Hope it helps,

Joe

11/1/2009 2:54:21 PM
Gravatar
Total Posts 20

Re: Newsletter function

Hi Joe,

Thanks again. I tried the contact from - it works like a charm. When I try to send a preview of the newsletter - it works like a charm. But when I try to send to subscribers it just adds the task to the queue and starts it but stays at 0%. I now have 3 mailer tasks in the queue all at 0%.

I hope you can help

 

Jacob :o)

11/2/2009 7:09:17 AM
Gravatar
Total Posts 18439

Re: Newsletter function

You did not mention whether there are any clues in the log.

I would delete all rows from mp_TaskQueue then recycle the app pool, then try again.

I cannot replicate this problem.

Make sure you have specified a valid email from address on the newsletter definition.

I would suggest if you cannot resolve it to try upgrading to the preview build I mentioned previously as a lot of work has been done to improve the newsletter.

Hope it helps,

Joe

11/2/2009 1:09:12 PM
Gravatar
Total Posts 20

Re: Newsletter function

The only thing in the log is what I pasted in my 1st. post.

I found the mp_TaskQueue table and deleted all the rows. But what do you mean with "recycle app pool"?

I have a valid "email from address".

Does the preview build support mysql? You only stated mssql in your post.

 

Regards Jacob :o)

11/2/2009 1:21:18 PM
Gravatar
Total Posts 20

Re: Newsletter function

After deleting it builds up more and more tasks in the queue without name and 0% progress.

11/2/2009 1:28:36 PM
Gravatar
Total Posts 20

Re: Newsletter function

I uploaded web.config again. And that seemed to get the task queue on track again. I now have:

WebTaskManager 11/2/2009 8:26:55 PM 11/2/2009 8:26:56 PM 11/2/2009 8:26:59 PM 50% Running
App Keep Alive Task 11/2/2009 8:26:52 PM 11/2/2009 8:26:59 PM 11/2/2009 8:26:59 PM 0% Started
2010 Mailer 11/2/2009 8:25:37 PM 11/2/2009 8:25:40 PM 11/2/2009 8:25:40 PM 0% Started
App Keep Alive Task 11/2/2009 8:23:35 PM 11/2/2009 8:23:39 PM 11/2/2009 8:23:49 PM 0% Running

11/2/2009 1:53:38 PM
Gravatar
Total Posts 18439

Re: Newsletter function

Hi,

I would take the web site offline by creating an app_offline.htm file and put it in the root. This way no more tasks will be created while you delete the existing ones. Then delete all rows from mp_TaskQueue, then download and upload your Web.config then remove the app_offline.htm file.

I do not have a preview available for MySql but maybe I can prepare one for you tomorrow.

Hope it helps,

Joe

11/2/2009 3:35:04 PM
Gravatar
Total Posts 18439

Re: Newsletter function

Hi,

I just uploaded a new build on our Novell Forge download page, mojoportal-mssql-build-2009-11-02.zip and I also uploaded a corresponding MySql Data layer mysqldatalayer-GPL-build-2009-11-02.zip

Please try upgrading to this build and see if it solves the problem, you may need to purge the mp_TaskQueue table again after upgrading.

This build is very close to a final release and you will be able to upgrade to the final release from this build.

Hope it helps,

Joe

11/3/2009 6:59:05 AM
Gravatar
Total Posts 20

Re: Newsletter function

Tried the suggestion about app_offline.htm aso. That changed the picture. Now a mailer task is generated and also run (ei. it dissapears from the queue). But the mails are still not send.

I'm gonna try with the preview build.

I'll  be back ;-)

11/3/2009 7:45:25 AM
Gravatar
Total Posts 20

Re: Newsletter function

Argh! After upgrading to the preview I get this when I try to load the hp:

Welcome to mojoPortal Setup

 

Probing system...

File system permissions ok.

MySQL database connection ok.

database permissions are sufficient to alter schema.

database initial schema already exists.

database core schema needs upgrade.

1 site(s) found.

This site appears to be running in a secured environment using Medium Trust policy or at least lower than Full Trust.

In order to use MySQL under Medium Trust, The MySQL Connector for .NET must be installed in the Global Assembly Cache on the server. If you see a SecurityException in the error message then the Connector is not installed. You can download the MySql Connector for .NET from here: http://dev.mysql.com/downloads/connector/net/5.0.html

 

 

Running script mojoportal-core - 2.3.2.0 - 00:00:00.2031250

MySql.Data.MySqlClient.MySqlException: Duplicate column name 'SubscribeGuid' at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId) at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() at MySql.Data.MySqlClient.MySqlScript.Execute() at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(FileInfo scriptFile, String overrideConnectionInfo) at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) - 00:00:00.2187500

Note: This page shows some information that is helpful during setup and upgrades but for security it would be best not to show any information when the system is up to date. You can disable setup and suppress all information on this page by setting DisableSetup=true in Web.config. When you need to upgrade, you can set this back to false. If you are logged in as Administrator setup will run and you will be able to see this page even if it is disabled in Web.config so you can easily leave it disabled and just login before upgrading. But if you are not logged in you will need to enable setup in Web.config.



11/3/2009 7:53:52 AM
Gravatar
Total Posts 18439

Re: Newsletter function

Hi,

That is very strange. Maybe you can solve it by chopping this part out of the /Setup/applications/mojoportal-core/SchemaUpgradeScripts/mysql/2.3.2.0.config file

 

ALTER TABLE mp_LetterSendLog ADD COLUMN `SubscribeGuid` char(36);
UPDATE mp_LetterSendLog
SET SubscribeGuid = '00000000-0000-0000-0000-000000000000';
CREATE INDEX idxSendLogsGuid ON mp_LetterSendLog(`SubscribeGuid`);

ALTER TABLE mp_LetterSendLog ADD COLUMN `SubscribeGuid` char(36);
UPDATE mp_LetterSendLogSET SubscribeGuid = '00000000-0000-0000-0000-000000000000';
CREATE INDEX idxSendLogsGuid ON mp_LetterSendLog(`SubscribeGuid`);

but I do not understand how that column could already exist in your installation as it does not exist in any previous script.

Since it is trying to run the script I think you can ignore th warning about medium trust as the MySql Connector must be in the GAC. It may be best to delete the MySql.Data.dll from the bin folder if it is using the one from the GAC.

Hope it helps,

Joe

 

11/3/2009 9:54:54 AM
Gravatar
Total Posts 20

Re: Newsletter function

Well then it just continues with an error on the next table in the same file:

Running script mojoportal-core - 2.3.2.0 - 00:00:00.0781250

MySql.Data.MySqlClient.MySqlException: Table 'mp_LetterSubscribe' already exists at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId) at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() at MySql.Data.MySqlClient.MySqlScript.Execute() at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(FileInfo scriptFile, String overrideConnectionInfo) at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) - 00:00:00.0937500

 

The frontpage looks like a mess: http://herreski.culmsee.dk

 

Is there any way of going back? I prefer to do without the newsletter function and have the rest working ;-)

11/3/2009 10:03:54 AM
Gravatar
Total Posts 18439

Re: Newsletter function

Only way to go back is if you made a backup of your site and db before upgrading. Or if you at least have a db backup you can delete the setup folder to get rid of newer version scripts, re-deploy version 2.3.1.9 and then restore your db.

However I do not understand how it can report an existing table when this is a new table not in any existing script.

You are actually the only one I know of running mojoPortal in Medium Trust with MySql. I don't see how that can make it see a table that has not been created as existing. 

I am sorry you are having these difficulties but I have no clue about these strange errors. I would look in the db and see if the table does exist and see if the mp_SendLog table has a column SubscribeGuid as reported in the previous error.

mojoPortal.com is running on MySql and went through this upgrade with no issues at all.

Best,

Joe

11/3/2009 10:15:35 AM
Gravatar
Total Posts 20

Re: Newsletter function

There is a SubscribeGuid in the mp_LetterSendLog. Also the table mp_LetterSubscribe and mp_LetterSubscribeHx (mentioned in 2.3.2.0.config) are both in the db.

But maybee it is suposed to give this error when I rerun the Setup?

Still the site is not functioning :-(

 

Jacob :o)

11/3/2009 10:19:28 AM
Gravatar
Total Posts 18439

Re: Newsletter function

After it runs a script it updates the schema version in the mp_SchemaVersion table according to the script version this way it should never run the same script more than once. You could look for the row for mojoportal-core in the mp_SchemaVersion folder and change it to 2.3.2.0 then it should move on to run the 2.3.2.1 and higher scripts.

Hope it helps,

Joe

11/3/2009 10:21:33 AM
Gravatar
Total Posts 20

Re: Newsletter function

Maybee I should try to install the previous version again and spend some time restoring what is lost because I didn't make the db backup.

Where is the pages I generated saved? Maybee theese tables can bee copied back into a new installation of the previous version? I just made some html and google maps.

 

Jacob :o)

11/3/2009 10:22:29 AM
Gravatar
Total Posts 20

Re: Newsletter function

Just saw your post from 11:19:28 I will try that.

Jacob :o)

11/3/2009 10:31:25 AM
Gravatar
Total Posts 20

Re: Newsletter function

I can't update the table. I get this error:

Error

SQL query: 

UPDATE `culmsee_dk_db`.`mp_SchemaVersion` SET `ApplicationID` = UUID( '077e4857-f583-488e-836e-34a4b04be855' ) ,`Build` = '2',`Revision` = '0' WHERE `mp_SchemaVersion`.`ApplicationID` = '077e4857-f583-488e-836e-34a4b04be855' LIMIT 1

 MySQL said:

 #1582 - Incorrect parameter count in the call to native function 'UUID' 

I have no idea what that means - do you?

11/3/2009 10:38:20 AM
Gravatar
Total Posts 18439

Re: Newsletter function

Hi,

Do it like this:

 

UPDATE mp_SchemaVersion
SET Build = 2,Revision = 0 
WHERE ApplicationID = '077e4857-f583-488e-836e-34a4b04be855';

UPDATE mp_SchemaVersion SET Build = 2,Revision = 0 WHERE ApplicationID = '077e4857-f583-488e-836e-34a4b04be855';

Hope it helps,

Joe

11/3/2009 12:18:04 PM
Gravatar
Total Posts 20

Re: Newsletter function

My site is back! :-))) Thanks.

The newsletter function however is still not running. The new progress bar just stays at "nothing" stating "started". So I guess it is more or less the same as before?

 

Jacob :o)

11/3/2009 1:42:03 PM
Gravatar
Total Posts 18439

Re: Newsletter function

Thanks for the beer Jacob!

It is very strange.

It should sleep for 10 seconds then it should log INFO: started LetterSendTask task

Now I do see one problem (a logic bug) in the LetterSendTask which could cause it to never send anything and never complete the task but it is unexpected conditions.

Letter letter = new Letter(this.letterGuid);

if (letter.LetterGuid == Guid.Empty) return;

if (letter.SendCompleteUtc > DateTime.MinValue) return;

if (letter.SendClickedUtc == DateTime.MinValue) return;

so the return there would prevent it from marking the task as complete so the task keeps running but isn't doing anything. I am correcting this logic now for the final release as follows.

Letter letter = new Letter(this.letterGuid);

if (letter.LetterGuid == Guid.Empty)

{

log.Error("LetterSendTask letter not found so ending.");

ReportStatus();

return;

}

if (letter.SendCompleteUtc > DateTime.MinValue)

{

log.Error("LetterSendTask SendCompleteUtc already set so ending.");

ReportStatus();

return;

}

if (letter.SendClickedUtc == DateTime.MinValue)

{

log.Error("LetterSendTask SendClickedUtc has an invalid value so ending.");

ReportStatus();

return;

}

This way it will report the problem in the log and end the task.

I will post here again as soon as the release ships or if I make another preview build with this fixed. I can only guess that one of these unexpected conditions is happening.

Best,

Joe

11/3/2009 2:11:47 PM
Gravatar
Total Posts 20

Re: Newsletter function

You're welcome. I appreciate your help.

And I'm looking foreward to the next release.

Thank you.

Jacob :o)

11/4/2009 3:14:14 PM
Gravatar
Total Posts 18439

Re: Newsletter function

I've uploaded a new interim build on our Novell Forge download page that at least should not get stuck and should log any problem that is happening. build-2009-11-04. I don't think it will solve the problem but it at least might give clues in the log and then maybe I could solve this for the official release, so I hope you will try the new build and let me know.

Best,

Joe

11/5/2009 2:02:22 PM
Gravatar
Total Posts 20

Re: Newsletter function

Hi Joe,

I will try it asap. Maybee tomorrow.

I'll let you know.

 

Jacob :o)

You must sign in to post in the forums. This thread is closed to new posts.