Problem Sending Java Mail to Hotmail With Apache James - jakarta-mail

I'm trying to send an email from James 3 to hotmail.com, but although no problem is indicated to the Java code, the mail is never sent. I'm sending from a user, "elliott#shevin.net" to "eshevin#hotmail.com".
I suspect the reason is revealed in the messages below from wrapper.log, but I'll send the entire log to anyone who asks.
Might something be missing from my configuration?
INFO | jvm 1 | 2022/10/02 14:18:11 | 02-Oct-2022 14:18:11.931 ERROR [smtpserver-executor-8] org.apache.james.domainlist.lib.AbstractDomainList.getDomainIpStream:246 - Cannot get IP address(es) for Domain : localhost
INFO | jvm 1 | 2022/10/02 14:18:12 | 02-Oct-2022 14:18:11.933 ERROR [smtpserver-executor-8] org.apache.james.domainlist.lib.AbstractDomainList.getDomainIpStream:246 - Cannot get IP address(es) for Domain : shevin.net
INFO | jvm 1 | 2022/10/02 14:18:12 | 02-Oct-2022 14:18:11.975 INFO [smtpserver-executor-12] org.apache.james.smtpserver.SendMailHandler.onMessage:75 - Successfully spooled mail Mail1664709491948-10458485-a750-4aeb-9d0b-6cba61e22308 from MaybeSender{mailAddress=Optional[elliott#shevin.net]} on 127.0.0.1/127.0.0.1 for [eshevin#hotmail.com]
INFO | jvm 1 | 2022/10/02 14:18:12 | 02-Oct-2022 14:18:11.983 INFO [smtpserver-executor-2] org.apache.james.protocols.netty.BasicChannelUpstreamHandler.channelClosed:171 - Connection closed for 127.0.0.1
INFO | jvm 1 | 2022/10/02 14:18:12 | 02-Oct-2022 14:18:12.463 ERROR [spooler-2] org.apache.james.transport.mailets.ToSenderFolder.doService:89 - Local delivery with ToSenderFolder mailet for mail Mail1664709491948-10458485-a750-4aeb-9d0b-6cba61e22308 with sender elliott#shevin.net in folder Sent
INFO | jvm 1 | 2022/10/02 14:18:12 | 02-Oct-2022 14:18:12.468 INFO [spooler-2] org.apache.james.domainlist.lib.AbstractDomainList.detectDomains:218 - Local host is: 10.0.0.10
INFO | jvm 1 | 2022/10/02 14:18:12 | 02-Oct-2022 14:18:12.469 WARN [spooler-2] org.apache.james.dnsservice.dnsjava.DNSJavaService.lookup:386 - Error determining result
INFO | jvm 1 | 2022/10/02 14:18:12 | java.lang.IllegalStateException: Lookup of localhost A isn't done

Related

FATAL: database "Employees" does not exist

Here is the console input-output, where I'm trying to access DB but psql cannot find it. I have tried changing capitalization, but result is the same
(base) username#MacBook-Pro-Ruslan ~ % psql -U username Employees
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database "Employees" does not exist
But, I have this DB in my Psql app, here the screenshoot of it
UPD: I just checked in command line all the databases
postgres-# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
----------------+----------------+----------+---------+-------+-----------------------------------
postgres | ruslanpilipyuk | UTF8 | C | C |
ruslanpilipyuk | ruslanpilipyuk | UTF8 | C | C |
template0 | ruslanpilipyuk | UTF8 | C | C | =c/ruslanpilipyuk +
| | | | | ruslanpilipyuk=CTc/ruslanpilipyuk
template1 | ruslanpilipyuk | UTF8 | C | C | =c/ruslanpilipyuk +
| | | | | ruslanpilipyuk=CTc/ruslanpilipyuk
(4 rows)
And it looks like that my psql app has not connected or transferred db between console. How could I get access to this db in app? That I already have. Db that are shown in list in console - are the Dbs that I created manually in console

Issue while uploading file from local to Snowflake table stage

I'm new to Snowflake and facing issue while uploading files from local to Snowflake table stage. I'm following Snowflake in 20 minutes training and stuck at the file uploading part, any help/pointer will be much appreciated. I have added the screen shot of the error in this post and below is one of the error message.
Error Message:
| source | target | source_size | target_size | source_compression | target_compression | status | message
|
|-----------------+--------------------+-------------+-------------+--------------------+--------------------+--------+-------------------------------
---------------------------------------|
| employees01.csv | employees01.csv.gz | 370 | 0 | NONE | GZIP | ERROR | Unknown Error in uploading a file: C:\Users\xxxx\AppData\Local\Temp\tmpj5iva8r7\employees01.csv_c.gz#y89s9rn7, file=c:\Temp\employees01.csv, real file=C:\Users\xxxx\AppData\Local
\Temp\tmpj5iva8r7\employees01.csv_c.gz |
Many Thanks!
Bharat
enter image description here
Can you please give it try to put file://c:\Temp\employees*.csv #%emp_basic;
Details: https://docs.snowflake.com/en/user-guide/data-load-local-file-system-stage.html

Can't connect to postgres on ubuntu

I have a ubuntu 20 on dreamcompute (which is cloud computing).
I create a user and a database. Here is the list of database and users (for some reason, I can't see database under a matt username).
I went into:
nano /etc/postgresql/13/main/postgresql.conf &
nano /etc/postgresql/13/main/pg_hba.conf and did the whole '*' and '0.0.0.0/0'
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+---------+---------+-----------------------
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
strapi | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =Tc/postgres +
| | | | | postgres=CTc/postgres+
| | | | | hossein=CTc/postgres
template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
as you can see you can't see Superuser and database strapi under the matt username.
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
matt | | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
ubuntu | | {}
I'm using my dream compute's ip address as my host and use my database and user and password but get error message: connection attempt time out.
Could someone please give me a pointer on why this is happening? I have been working onthis for 2 weeks now and I can't get it to work.
Error message is connection time out. That usually means that the port is blocked by a firewall. Check your cloud provider firewall settings and iptablesin your Linux box in case you have installed it.
If there was problem with permissions, the error message would be something else.
as ex4 mentioned above I needed to reachout to the company that I was renting my cloud computer from but I still could not connect to the database.
The way I went around it is that you can ssh into your database and then connect to your database as a localhost since you are ssh into your cloud computer.
In DBeaver you have a ssh tab and you can connect and then you got back to your postgres tab and fill the localhost, user, database name, and user password area and simply click connect.
Sadly this took weeks to come to this :/

MemSQL database not available for reads while leaf node is in replicating mode

I have a CentOS server running a local memsql cluster (aggregator and leaf on the same machine). I have a databse named offers. For some reason, I cannot execute any queries against tables in my database.
Everything was working fine until I tried to add another machine to the cluster. I had the IT team at my place replicate the server I was working on (completely). I went over to the replicated server, deleted the database in question and then registered the server using the memsql-toolbox-config register-node command. Then the database showed it was under the transition state. I restarted memsql using memsql-ops and got to this situation.
Running a simple query yields:
memsql> select * from table;
ERROR 2261 (HY000): Query `select * from table` couldn't be executed because of an in progress failover operation. Check the status of the leaf nodes in the cluster (error 1049:'Leaf Error (172.26.32.20:3307): Unknown database 'offers_5'')
The output for the the cluster status command is:
memsql> show cluster status;
+---------+--------------+------+----------+-------------+-------------+----------+--------------+-------------+-------------------------+----------------------+----------------------+---------------+-------------------------------------------------+
| Node ID | Host | Port | Database | Role | State | Position | Master Host | Master Port | Metadata Master Node ID | Metadata Master Host | Metadata Master Port | Metadata Role | Details |
+---------+--------------+------+----------+-------------+-------------+----------+--------------+-------------+-------------------------+----------------------+----------------------+---------------+-------------------------------------------------+
| 1 | 172.26.32.20 | 3306 | cluster | master | online | 0:181 | NULL | NULL | NULL | NULL | NULL | Reference | |
| 1 | 172.26.32.20 | 3306 | offers | master | online | 0:156505 | NULL | NULL | NULL | NULL | NULL | Reference | |
| 2 | 172.26.32.20 | 3307 | cluster | async slave | replicating | 0:180 | 172.26.32.20 | 3306 | 1 | 172.26.32.20 | 3306 | Reference | stage: packet wait, state: x_streaming, err: no |
| 2 | 172.26.32.20 | 3307 | offers | sync slave | replicating | 0:156505 | 172.26.32.20 | 3306 | 1 | 172.26.32.20 | 3306 | Reference | |
+---------+--------------+------+----------+-------------+-------------+----------+--------------+-------------+-------------------------+----------------------+----------------------+---------------+-------------------------------------------------+
4 rows in set (0.00 sec)
So it seems that the the second node is replicating. Also note the details column saying:
stage: packet wait, state: x_streaming, err: no
Running the replication status command gives:
memsql> show replication status;
+--------+----------+------------+--------------+------------------+--------------------+------------------+----------------+----------------+-----------+---------------------------+-------------+-----------------+-------------------+-----------------+---------------+---------------+
| Role | Database | Master_URI | Master_State | Master_CommitLSN | Master_HardenedLSN | Master_ReplayLSN | Master_TailLSN | Master_Commits | Connected | Slave_URI | Slave_State | Slave_CommitLSN | Slave_HardenedLSN | Slave_ReplayLSN | Slave_TailLSN | Slave_Commits |
+--------+----------+------------+--------------+------------------+--------------------+------------------+----------------+----------------+-----------+---------------------------+-------------+-----------------+-------------------+-----------------+---------------+---------------+
| master | cluster | NULL | online | 0:181 | 0:181 | 0:177 | 0:181 | 86 | yes | 172.26.32.20:3307/cluster | replicating | 0:180 | 0:181 | 0:180 | 0:181 | 84 |
| master | offers | NULL | online | 0:156505 | 0:156505 | 0:156505 | 0:156505 | 183 | yes | 172.26.32.20:3307/offers | replicating | 0:156505 | 0:156505 | 0:156505 | 0:156505 | 183 |
+--------+----------+------------+--------------+------------------+--------------------+------------------+----------------+----------------+-----------+---------------------------+-------------+-----------------+-------------------+-----------------+---------------+---------------+
2 rows in set (0.00 sec)
I never initiated any fail over or replication. Anyone knows why this is happening? How could I solve this?
EDIT:
Using memsql-ops I get:
[me#memsql ~]$ memsql-ops memsql-list
ID Agent Id Process State Cluster State Role Host Port Version
33829AF Af13af7 RUNNING CONNECTED MASTER 172.26.32.20 3306 6.5.18
BBA1B61 Af13af7 RUNNING CONNECTED LEAF 172.26.32.20 3307 6.5.18
But with memsql-admin, with the new memsql tools:
[me#memsql ~]$ memsql-admin list-nodes
✘ Failed to list nodes on all hosts: failed to list nodes on 1 host:
172.26.32.20
No nodes found
Making my question a bit clearer - How can I get my server to respond to queries again? And after I do, How should I act to add another host? Should I clean the replicated server completely of any memsql data?
2nd EDIT:
I managed to solve this problem by delete my database and cluster data, and setting up a new one using the new MemSQL tools, throwing away MemsqlOps. Read my answer.
It looks like there are a couple things that might be causing problems. Generally speaking, cloning a memsql server is not something that is supported nor the best way to go about adding nodes. It also looks like you may be using both the older Ops management tool and the newer MemSQL tools. I would recommend not installing or using Ops and sticking to just the new MemSQL tools instead.
A good place to start would be to try recreating the nodes after cloning; a cloned memsql node won't correctly become part of the cluster. You should also verify that you don't have more than one master aggregator in the cluster. If you can start with that and see if it resolves your issues I'm happy to help with any other problems that you run into.
I managed to set up a working cluster.
As micahbhakti mentioned in his answer, I tried using only the newer MemSQL tools, instead of the deprecated MemSQL Ops. It required deleting the MemSQL agent existing on both servers and then following the tutorial in the MemSQL documentation. Here are the steps I took for anyone struggling with this issue which is better described as: My MemSQL-Ops-managed-MemSQL-cluster is not responding. How can I upgrade it to a working MemSQL-tools-managed-cluster?
1. Save what data you can
The following step is to delete all memsql data, so it would be best if you could save your data. The table data could be stored in CSV files easily with a simple
SELECT * FROM important_data_containing_table INTO OUTFILE '/home/yourfolder/yourcsvfile.csv';
Do this for all tables containing important data. You could also save the scheme itself. You can do that by viewing and copying to another file all the create queries you used to create the table originally, to re-execute them later. Use this
SHOW CREATE TABLE your_table_name
The documentation for mysql is described here. It might not be similar to the syntax used in mem, but the above base command works. For exact information, read about MySQL Features Unsupported in MemSQL.
2. Delete anything to do with Memsql-Ops
As it is said here about the uninstall command:
Stops the local MemSQL Ops agent and deletes all its data.
If MemSQL nodes are already installed in the local host, this command will prompt users to delete those nodes first before proceeding with the uninstall.
And indeed, if there is a node runnning (in my case there were), you will be prompted to run another command to delete those nodes: memsql-ops memsql-delete --all. This WILL delete all data in your database as said in it's documentation:
Deletes all data for a MemSQL node. This operation is not reversible and may lead to data loss. Users who want to perform this operation are prompted to explicitly type ‘DELETE’ to be sure of their decision.
That's why I asked you to save what ever you need :)
This should be done for each host you want to include in your new shiny cluster.
3. Follow the instructions to create the new cluster using MemSQL tools
After you cleaned your servers from the deprecated MemSQL ops agent and data, you can follow the instructions here. I chose to set up a multiple host comprehensive set up. The process will ask you to register your hosts, and then set up the nodes roles (master aggregator, aggreators and leafs), ip addresses, passwords, ports and etc.
After that, you can try to test the cluster, making changes in one machine and view them in another. Also the output for memsql-admin list-nodes on the deploying machine for my cluster was:
+------------+------------+--------------+------+---------------+--------------+---------+----------------+--------------------+
| MemSQL ID | Role | Host | Port | Process State | Connectable? | Version | Recovery State | Availability Group |
+------------+------------+--------------+------+---------------+--------------+---------+----------------+--------------------+
| AAAAAAAAAA | Master | 172.26.32.20 | 3306 | Running | True | 6.7.16 | Online | |
| BBBBBBBBBB | Aggregator | 172.26.32.22 | 3306 | Running | True | 6.7.16 | Online | |
| CCCCCCCCCC | Leaf | 172.26.32.20 | 3307 | Running | True | 6.7.16 | Online | 1 |
| DDDDDDDDDD | Leaf | 172.26.32.22 | 3307 | Running | True | 6.7.16 | Online | 1 |
+------------+------------+--------------+------+---------------+--------------+---------+----------------+--------------------+
4. Restore the data
Re-execute all the create table queries you saved in step 1, and import all data exported to a csv using this syntax:
LOAD DATA INFILE '/home/yourfolder/yourcsvfile.csv' INTO TABLE your_table;
And that's it! Now you can manage your cluster using the new MemSQL studio that run on the default http://your_deployment_machine:8080.
Enjoy :)

Robot Framework data-driven automation testing: Can data derived from a database be used as a data source for a test template?

I am familiar with using template keywords in data-driven Robot Framework testing and know that external sources of data such as text files and csv files can be used to provide test data. However, the organisation I work for wants to use data held in a database as a source for test case data. Does anybody know if this is possible? I have searched Stack Exchange, Stack Overflow and other resources but cannot find an answer or any examples.
Here is an example of the data-driven approach I am familiar just to give you an idea of where we are now.
*** Settings ***
Library Selenium2Library
Library AFRCLibrary
| Test Template | Suspend Region
*** Variables ***
*** Test Cases ***
| Pillar 1 BPS 2019 Suspend Region | Pillar 1 | 2019 | BPS | BPS Region 1 | Pillar 1 BPS 2019 Suspend Region Comments |
| Pillar 2 FGS 2018 Suspend Region | Pillar 2 | 2018 | FGS | FGS Region 1 | Pillar 2 FGS 2018 Suspend Region Comments |
*** Keywords ***
| Suspend Region
| | [Arguments] | ${pillar} | ${year} | ${scheme} | ${region} | ${comments} |
| | Futures Open Application | http://ags125p01:8080/operationalsite/login | ff |
| | FuturesPublicsiteWM | root | gtn | http://ags125p01:8080/operationalsite/futures/maintain_budget |
| | Select Pillar | ${pillar} | ${year} |
| | Select Scheme | ${scheme} |
| | View |
| | Suspend And Confirm | ${region} | ${comments} |
| | Futures Close Application |
| |
Unfortunately, the use of test templates more-or-less require that the data is hard-coded in the test case. However, the test template is not much more than a wrapper around a for loop. You could do something like this:
| | ${database_rows}= | Run sql query
| | ... | Select * from the_database where ...
| |
| | :FOR | ${row} | IN | #{database_rows}
| | | Suspend Region | #{row}
Of course, this requires that you write the "Run sql query" keyword or an equivalent to fetch the data.
The downside of this is that all of the permutations are considered a single test case with multiple keywords, versus multiple test cases with a single keyword.
If you want to have one test case per row in a database, you could write a script that does the query, generates a test suite file using the results of the query, and then runs pybot on the generated file.

Resources