Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid cast in scheduler job #12

Closed
roman-yagodin opened this issue Jun 15, 2017 · 7 comments
Closed

Invalid cast in scheduler job #12

roman-yagodin opened this issue Jun 15, 2017 · 7 comments

Comments

@roman-yagodin
Copy link

AbsoluteURL:
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:3d63002b-3a50-4966-a644-f606221faff6
AssemblyVersion:
PortalId:-1
UserId:-1
TabId:-1
RawUrl:
Referrer:
UserAgent:
ExceptionHash:9C/8JgCRRgc+GLG7cBVMvQ==
Message:Cast the string "" to the "Integer" type is invalid [message translated from russian]
StackTrace:
   in Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
   in DotNetNuke.Modules.Forum.CleanupEmailQueuedTasks.DoWork()
InnerMessage:Входная строка имела неверный формат.
InnerStackTrace:
   in Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
   in Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
Source:Microsoft.VisualBasic
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
Server name: web
@juvander
Copy link
Member

Check in Forum admin settings that you have proper values in Queue settings.

@roman-yagodin
Copy link
Author

roman-yagodin commented Jun 16, 2017

Email queue was disabled. I enabled it, then started "Cleanup Forum Email History" and "Send Forum Emails" schedulers manually, but exception still throwned.

@juvander
Copy link
Member

Yes, but check the setting on forum admin side, there is two values for these that need to have proper value.

@roman-yagodin
Copy link
Author

roman-yagodin commented Jun 16, 2017

You mean these ones?

Task History (days): 30
Email History (days): 30

@juvander
Copy link
Member

Yes

@roman-yagodin
Copy link
Author

roman-yagodin commented Jun 16, 2017

I updated Queue settings w/o changing any values, then re-run forum schedulers - so far no exceptions in the log.

Possible source in IEmailQueueableCleanupTask.vb:

If Not Me.ScheduleHistoryItem.GetSetting("ForumTaskDeleteDays") Is Nothing Then
    Dim DaysToDelete As Integer = 30 ' default value
    If (Me.ScheduleHistoryItem.GetSetting("ForumTaskDeleteDays").Trim() <> "") Then
        DaysToDelete = CInt(Me.ScheduleHistoryItem.GetSetting("ForumTaskDeleteDays"))
    End If
    ' (1) else use default value
    tasksDeleteDate = Date.Now.AddDays(-DaysToDelete)
End If

If Not Me.ScheduleHistoryItem.GetSetting("ForumEmailDeleteDays") Is Nothing Then
    Dim DaysToDelete As Integer = 30 ' default value
    If (Me.ScheduleHistoryItem.GetSetting("ForumEmailDeleteDays").Trim() <> "") Then
        DaysToDelete = CInt(Me.ScheduleHistoryItem.GetSetting("ForumEmailDeleteDays"))
    End If
    ' this line should not be here - compare with (1)
    DaysToDelete = CInt(Me.ScheduleHistoryItem.GetSetting("ForumEmailDeleteDays"))

    emailsDeleteDate = Date.Now.AddDays(-DaysToDelete)
End If

@juvander
Copy link
Member

Yes. I believe this setting is written only when you update something on those queue settings. Simply enabling it is not enough.

juvander added a commit that referenced this issue Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants