Settings - Email - can't change User Name

Topics: Core, General, Troubleshooting
Mar 8, 2012 at 1:19 PM
Edited Mar 8, 2012 at 1:43 PM

I am attempting to change the User name field within the Email module within Settings and no matter how many times I try to change and save this field, it keeps reverting back to the old field value.

Even when I un-check the Require credentials check box, and save it comes back with the orginal Checked value.

From a review of the log file I see this relating exception ...

2012-03-08 05:02:30,379 [28] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentException thrown from IContentPartDriver by Orchard.Email.Drivers.SmtpSettingsPartDriver
System.ArgumentException: Value does not fall within the expected range.
   at Orchard.Security.Providers.DefaultEncryptionService.Decode(Byte[] encodedData) in d:\Builds\OrchardFull\src\Orchard\Security\Providers\DefaultEncryptionService.cs:line 33
   at Orchard.Email.Handlers.SmtpSettingsPartHandler.<>c__DisplayClass2.<LazyLoadHandlers>b__0()
   at Orchard.ContentManagement.Utilities.ComputedField`1.GetValue() in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Utilities\ComputedField.cs:line 22
   at Orchard.Email.Drivers.SmtpSettingsPartDriver.<>c__DisplayClass8.<Editor>b__7()
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClassd.<ContentShape>b__c(BuildShapeContext ctx) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 74
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass13.<ContentShapeImplementation>b__12(BuildShapeContext ctx) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 82
   at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 37
   at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildEditorContext context) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 25
   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClass10.<UpdateEditor>b__f(IContentPartDriver driver) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 63
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\Builds\OrchardFull\src\Orchard\InvokeExtensions.cs:line 19

Any thoughts?

Mar 8, 2012 at 4:58 PM

I had the same thing happen on one of my sites that I upgraded to 1.4. Is this an upgraded site? Clean installs worked without any issues, and one of my other sites that I upgraded seems to be working fine as well.

For the one site that has the same issue, I also noticed that emails are not being sent out.

To resolve this, I did the following:

1. Disable the Email module from the admin panel

2. Delete the Orchard.Email folder under /Modules

3. Delete the Orchard_Email_SmtpSettingsPartRecord table in the database

4. Delete the row in the Orchard_Framework_DataMigrationRecord table for Orchard.Email.Migrations

5. In the admin panel, go out to the Gallery and install the Orchard Email 1.4 module again

6. Re-enter your SMTP settings

Everything should work fine after this. Hope that helps.

Mar 8, 2012 at 5:00 PM
psenechal wrote:

I had the same thing happen on one of my sites that I upgraded to 1.4. Is this an upgraded site? Clean installs worked without any issues, and one of my other sites that I upgraded seems to be working fine as well.

For the one site that has the same issue, I also noticed that emails are not being sent out.

To resolve this, I did the following:

1. Disable the Email module from the admin panel

2. Delete the Orchard.Email folder under /Modules

3. Delete the Orchard_Email_SmtpSettingsPartRecord table in the database

4. Delete the row in the Orchard_Framework_DataMigrationRecord table for Orchard.Email.Migrations

5. In the admin panel, go out to the Gallery and install the Orchard Email 1.4 module again

6. Re-enter your SMTP settings

Everything should work fine after this. Hope that helps.

I don't think step 2 is necessary. Then in step 5, just enable it again.

 

You could however attach a debugger and check the values that are actually used when it crashes.

Mar 8, 2012 at 5:29 PM

True with step 2...I just wanted to make sure that the files hadn't been corrupted in any way.

I used the release version, not the source enlistment for this site...is there still a way to attach a debugger with the release version?

Mar 8, 2012 at 5:51 PM

Thanks for your quick support on this, I will give this a whirl. I am still running 1.3.

Coordinator
Mar 8, 2012 at 6:32 PM

I you updated the website, and your settings.txt file got regenerated, then it is that your encryption keys are new. You might want to copy-paste them from the old settings.txt

Coordinator
Mar 8, 2012 at 6:32 PM

And yes, this could be added in the upgrade notes from those who just copy the database.

Mar 9, 2012 at 4:51 AM

That did the trick, Email messaging is working. Just a slight change in your instructions.  Step 3 you say delete the table. This caused an exception in step 5. So I restored the database and instead deleted the single row in that table and it all started working once again.  Thanks.

 

I do however now have this upgrade warning on Email messaging however when I attempt to process the upgrade I get the following exception ...

 

The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2073550
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5064508
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest) +770
   System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest) +347
   System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(TransactionRequest transactionRequest, String name, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest) +154
   System.Data.SqlClient.SqlDelegatedTransaction.SinglePhaseCommit(SinglePhaseEnlistment enlistment) +386

[TransactionAbortedException: The transaction has aborted.]
   System.Transactions.TransactionStateAborted.EndCommit(InternalTransaction tx) +11
   System.Transactions.CommittableTransaction.Commit() +239
   System.Transactions.TransactionScope.InternalDispose() +402
   System.Transactions.TransactionScope.Dispose() +1450
   Orchard.Data.TransactionManager.System.IDisposable.Dispose() in TransactionManager.cs:47
   Autofac.Core.Disposer.Dispose(Boolean disposing) +79
   Autofac.Util.Disposable.Dispose() +46
   Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing) +21
   Autofac.Util.Disposable.Dispose() +46
   Orchard.Environment.<>c__DisplayClass2.<.ctor>b__0() in WorkContextAccessor.cs:75
   Orchard.Environment.HttpContextScopeImplementation.System.IDisposable.Dispose() in WorkContextAccessor.cs:80
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in ShellRoute.cs:151
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8969201
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184