Fetching messages in the requested folder error - mailcore2

I've got an error when I updated the mailcore2 and used this method fetchMessageOperationWithFolder. The error is "An error occured while fetching messages in the requested folder."
Sorry I can't post any image yet!
Below is the result of my connection logger:
2014-11-19 15:16:52.531[485:45236] ERRORError Domain=MCOErrorDomain Code=19 "An error occured while fetching messages in the requested folder." UserInfo=0x16788f80 {NSLocalizedDescription=An error occured while fetching messages in the requested folder.}
2014-11-19 15:16:52.545[485:45236] ()
2014-11-19 15:16:52.546[485:45236] INBOX
2014-11-19 15:16:52.547[485:45236] 9501
2014-11-19 15:16:54.110[485:45392] * OK Gimap ready for requests from 112.208.143.218 zq5mb132787189pbc
2014-11-19 15:16:54.122[485:45392] 1 CAPABILITY
2014-11-19 15:16:54.577[485:45392] * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN
1 OK Thats all she wrote! zq5mb132787189pbc
2014-11-19 15:16:54.579[485:45392] 2 LOGIN "jcartas#village88.com" v31j10jer826
2014-11-19 15:16:55.318 [485:45392] * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT
2 OK jcartas#village88.com authenticated (Success)
2014-11-19 15:16:55.320[485:45392] 3 COMPRESS DEFLATE
2014-11-19 15:16:55.934 [485:45392] 3 OK Success
2014-11-19 15:16:55.935 [485:45392] 4 ENABLE CONDSTORE
2014-11-19 15:16:56.547 [485:45392] * ENABLED CONDSTORE
4 OK Success
2014-11-19 15:16:56.549 [485:45392] 5 NAMESPACE
2014-11-19 15:16:57.264 [485:45392] * NAMESPACE (("" "/")) NIL NIL
5 OK Success
2014-11-19 15:16:57.266 [485:45392] 6 ID NIL
2014-11-19 15:16:58.493 [485:45392] * ID ("name" "GImap" "vendor" "Google, Inc." "support-url" "http://support.google.com/mail" "version" "gmail_imap_141111.06_p1" "remote-host" "112.208.143.218")
6 OK Success
2014-11-19 15:16:58.495 [485:45392] 7 SELECT INBOX
2014-11-19 15:16:59.107 [485:45392] * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Phishing $NotPhishing)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Phishing $NotPhishing \*)] Flags permitted.
* OK [UIDVALIDITY 1] UIDs valid.
* 721 EXISTS
* 0 RECENT
* OK [UIDNEXT 868] Predicted next UID.
* OK [HIGHESTMODSEQ 83158]
7 OK [READ-WRITE] INBOX selected. (Success)
2014-11-19 15:16:59.109 [485:45392] 8 UID FETCH 9501 BODY.PEEK[]
2014-11-19 15:16:59.721 [485:45392] 8 OK Success

Related

Karate - How to use retry until when there are 2 different requests in the same scenario

If I send one request in a scenario and use retry until as shown in the syntax below then the retry until works fine:
Scenario Outline: x
Given url 'x'
Then retry until status 200
When method get
Examples:
| productId | postcode |
| 'xxxx' | 'yyyy' |
However, if I then send ANY other request afterwards (to make things simple I will just send exactly the same request)..
Scenario Outline: x
Given url 'x'
Then retry until status 200
When method get
//Send ANY other request here:
When method get
Examples:
| productId | postcode |
| 'xxxx' | 'yyyy' |
Then I see the following error message:
11:59:09.820 [main] WARN com.intuit.karate - retry condition evaluation failed: js failed:
>>>>
01: status 200
<<<<
org.graalvm.polyglot.PolyglotException: SyntaxError: Unnamed:1:7 Expected ; but found 200
status 200
^
How do I use retry until when there is more than one request sent in the scenario?
(1) retry until must come BEFORE each method keyword
(2) The correct syntax = retry until responseStatus == 200
Scenario Outline: x
Given url 'x'
Then retry until responseStatus == 200
When method get
//Send ANY other request here:
Then retry until responseStatus == 200
When method get
Examples:
| productId | postcode |
| 'xxxx' | 'yyyy' |
The retry should always be before the method keyword. Read the docs: https://github.com/karatelabs/karate#retry-until

What is the idea behind the fact that using '\\_' and '_' have the same effect in Hive split function?

I just found out that in hive script, the effect of splitting a string with delimiter '_' and '\_' are the same. However, underscore is not a special character in hive. Any idea why?
0: jdbc:hive2://hadoopzk10-phx2.prod.uber.int> select split('2_1122', '_')[0];
INFO : Compiling command(queryId=hive_20220328223849_deeabdc9-ead3-43af-ab13-17de9c3d9cf5): select split('2_1122', '_')[0]
INFO : Semantic Analysis Completed
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:string, comment:null)], properties:null)
INFO : Completed compiling command(queryId=hive_20220328223849_deeabdc9-ead3-43af-ab13-17de9c3d9cf5); Time taken: 0.106 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=hive_20220328223849_deeabdc9-ead3-43af-ab13-17de9c3d9cf5): select split('2_1122', '_')[0]
INFO : Completed executing command(queryId=hive_20220328223849_deeabdc9-ead3-43af-ab13-17de9c3d9cf5); Time taken: 0.036 seconds
INFO : OK
+------+--+
| _c0 |
+------+--+
| 2 |
+------+--+
1 row selected (0.152 seconds)
0: jdbc:hive2://hadoopzk10-phx2.prod.uber.int> select split('2_1122', '\\_')[0];
INFO : Compiling command(queryId=hive_20220328223906_1cf0c657-bc91-44e2-8cea-4f989ae53d9f): select split('2_1122', '\\_')[0]
INFO : Semantic Analysis Completed
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:string, comment:null)], properties:null)
INFO : Completed compiling command(queryId=hive_20220328223906_1cf0c657-bc91-44e2-8cea-4f989ae53d9f); Time taken: 0.101 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=hive_20220328223906_1cf0c657-bc91-44e2-8cea-4f989ae53d9f): select split('2_1122', '\\_')[0]
INFO : Completed executing command(queryId=hive_20220328223906_1cf0c657-bc91-44e2-8cea-4f989ae53d9f); Time taken: 0.033 seconds
INFO : OK
+------+--+
| _c0 |
+------+--+
| 2 |
+------+--+
1 row selected (0.146 seconds)
I ask this question just out of curiosity. Feel free to share your thoughts.

Get the reply of an outgoing message in the same row in SQL?

I am trying to get the incoming message for an outgoing message in the same row as response? So, the data looks like below:
user_id message type
1 What's your name? outgoing
1 Nitin incoming
1 What's your age? outgoing
1 17 incoming
2 What's your name? outgoing
2 Aayush incoming
2 What's your age? outgoing
3 What's your name? outgoing
4 What's your name? outgoing
4 Shubham incoming
4 What's your age? outgoing
The output should look like:
user_id message type reply
1 What's your name? outgoing Nitin
1 Nitin incoming
1 What's your age? outgoing 17
1 17 incoming
2 What's your name? outgoing Aayush
2 Aayush incoming
2 What's your age? outgoing No-reply
3 What's your name? outgoing No-reply
4 What's your name? outgoing Shubham
4 Shubham incoming
4 What's your age? outgoing No-reply
The reply is an incoming message for an outgoing message for a user_id & if there is no reply for an outgoing message then the reply column should be filled by 'No-reply'. I have to do this in PSQL. I am currently able to do this in python after fetching data from DB.
Below is my current python code.
df['reply'] = np.where((df['user_id'] == df['user_id'].shift(-1))
& (df['type'].eq('Outgoing') & df['type'].shift(-1).eq('Incoming')),
df['message'].shift(-1), 'No-reply')
Assuming that you have a column that can be used to order the records (called id), you could use lead() as follows:
select
t.*,
case
when type = 'outgoing'
and lead(type) over(partition by user_id order by id) = 'incoming'
then lead(message) over(partition by user_id order by id)
when type = 'outgoing' then 'no reply'
end reply
from mytable
This query checks if the current record has type outgoing and if the next one (for the same user) is of type incoming: if both conditions are true, then it recovers the message on the next record and displays it as reply. If type is outgoing but the next message is not incoming, then it gives no reply. In other cases, nothing is printed.

SQL server "Cannot send mails to mail server" "Failure sending mail"

I am using MS SQL Server 2008 R2 SP2 Express edition, 64 bit.
I do not have access to the Database Mail setup wizard, but the Binn directory contains DatabaseMail.exe (v10.50.16600.1) and DatabaseMailengine.dll.
I found several references to "Cannot send mails to mail server", but nothing useful with the annoyingly generic "Failure sending mail" message.
My specific question is where can I find out what that error message means/what causes it? If some kind soul would care to hazard a guess about what is going on, or not going on, I would appreciate it.
Setup info from the database follows:
EXECUTE sp_configure 'show advanced'
name minimum maximum config_value run_value
show advanced options 0 1 1 1
EXECUTE sp_configure 'Database Mail XPs'
name minimum maximum config_value run_value
Database Mail XPs 0 1 1 1
sysmail_server
account_id servertype servername port username credential_id use_default_credentials enable_ssl flags timeout last_mod_datetime last_mod_user
1 SMTP smtp.gmail.com 465 sqlmail#domain.com 65536 0 1 0 NULL 2015-11-23 09:34:26.913 WSCORP\username
sys.credentials
credential_id name credential_identity create_date modify_date target_type target_id
65536 F05ADE33-6AA8-45FC-8FF5-A7631831ECB1 sqlmail#domain.com 2015-11-23 09:34:26.913 2015-11-23 09:34:26.913 NULL NULL
EXEC msdb.sys.sp_helprolemember 'DatabaseMailUserRole'
DbRole MemberName MemberSID
DatabaseMailUserRole WSCORP\username 0x010500000000000515000000F483990DEADF2220C7DB306E6B040000
EXEC msdb.dbo.sysmail_help_principalprofile_sp
principal_id principal_name profile_id profile_name is_default
27 WSCORP\username 1 Default 1
EXECUTE dbo.sysmail_start_sp
Status
STARTED
sysmail_account
account_id name description email_address display_name replyto_address last_mod_datetime last_mod_user
1 SQLMail NULL sqlmail#domain.com SQLExpresspay12 Mail user#domain.com 2015-11-23 09:34:26.843 WSCORP\username
sysmail_profile
profile_id name description last_mod_datetime last_mod_user
1 Default Default profile 2015-11-23 09:56:58.947 WSCORP\username
sysmail_profileaccount
profile_id account_id sequence_number last_mod_datetime last_mod_user
1 1 1 2015-11-23 10:02:29.867 WSCORP\username
sysmail_servertype
servertype is_incoming is_outgoing last_mod_datetime last_mod_user
SMTP 0 1 2010-04-02 17:36:17.340 sa
sysmail_mailitems
mailitem_id profile_id recipients copy_recipients blind_copy_recipients subject from_address reply_to body body_format importance sensitivity file_attachments attachment_encoding query execute_query_database attach_query_result_as_file query_result_header query_result_width query_result_separator exclude_query_output append_query_error send_request_date send_request_user sent_account_id sent_status sent_date last_mod_date last_mod_user
4 1 user#domain.com NULL NULL Test message NULL NULL This is the body of the test message. TEXT NORMAL NORMAL NULL MIME NULL NULL 0 1 256 0 0 0 2015-11-24 08:23:59.493 WSCORP\username NULL 2 11/1124/20158 8:25:20 11/24/2015 08:25:20 sa
Congratulations, Database Mail Received
By you Successfully.
sysmail_log
log_id event_type log_date description process_id mailitem_id account_id last_mod_date last_mod_user
13 1 2015-11-24 08:23:59.787 DatabaseMail process is started 7324 NULL NULL 2015-11-24 08:23:59.787 NT AUTHORITY\NETWORK SERVICE
14 1 2015-11-24 08:24:10.270 The mail queue was started by login "WSCORP\username". NULL NULL NULL 2015-11-24 08:24:10.270 WSCORP\username
15 3 2015-11-24 08:24:10.297 The mail could not be sent to the recipients because of 7324 4 NULL 2015-11-24 08:24:10.297 sa
the mail server failure. (Sending Mail using Account 1
(2015-11-24T08:24:10). Exception Message: Cannot send
mails to mail server. (Failure sending mail.). )
Google wanted me to use the TLS port (587) even though, as far as I can tell, there was no way to tell the SQL server to use TLS. So specifying SSL and using the TLS port worked.

SQL Server 2005 DbMail not sending

I have a SQL Server 2005 DB Mail profile set up on my server that successfully sends a test email. However, when I queue an email in the msdb.dbo.sysmail_mailitems table, it does not ever try to send it. The status of the item stays at 0 (unsent).
In the Database Mail Log, the following entries are shown:
event_type log_date description process_id mailitem_id account_id last_mod_date last_mod_user
0 2012-05-07 10:07:00.887 Activation successful. NULL NULL NULL 2012-05-07 10:07:00.887 sa
1 2012-05-07 10:07:06.323 DatabaseMail process is started 6504 NULL NULL 2012-05-07 10:07:06.323 NT AUTHORITY\SYSTEM
3 2012-05-07 10:07:07.213 Could not retrieve item from the queue. 6504 NULL NULL 2012-05-07 10:07:07.213 NT AUTHORITY\SYSTEM
1 2012-05-07 10:12:07.453 DatabaseMail process is shutting down 6504 NULL NULL 2012-05-07 10:12:07.453 NT AUTHORITY\SYSTEM
There are no exceptions in the windows event viewer. Can someone direct me to where I can find more info regarding the error? "Could not retrieve item from the queue." doesn't help me much.
Thanks