double_click method is not working in firefox - watir

double_click method to doubleclick is not working with firefox browser. As it displays the below error message. The same method works fine with chrome browser.
Error Message:
Selenium::WebDriver::Error::InvalidElementStateError: Cannot perform native interaction: Could not get node for element - cannot interact.
from [remote server] file:///C:/Users/Niresh/AppData/Local/Temp/webdriver-profile20141004-2520-nez9f5/extensions/fxdriver#googlecode.com/components/driver-component.j
s:9918:3:in generateErrorForNativeEvents'
from [remote server] file:///C:/Users/Niresh/AppData/Local/Temp/webdriver-profile20141004-2520-nez9f5/extensions/fxdriver#googlecode.com/components/driver-component.j
s:10037:7:inFirefoxDriver.prototype.mouseDoubleClick'
from [remote server] file:///C:/Users/Niresh/AppData/Local/Temp/webdriver-profile20141004-2520-nez9f5/extensions/fxdriver#googlecode.com/components/command-processor.
js:11612:16:in DelayedCommand.prototype.executeInternal_/h'
from [remote server] file:///C:/Users/Niresh/AppData/Local/Temp/webdriver-profile20141004-2520-nez9f5/extensions/fxdriver#googlecode.com/components/command-processor.
js:11617:7:inDelayedCommand.prototype.executeInternal_'
from [remote server] file:///C:/Users/Niresh/AppData/Local/Temp/webdriver-profile20141004-2520-nez9f5/extensions/fxdriver#googlecode.com/components/command-processor.
js:11559:5:in DelayedCommand.prototype.execute/<'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/response.rb:52:inassert_ok'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/response.rb:15:in initialize'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/common.rb:59:innew'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/common.rb:59:in create_response'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:66:inrequest'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/common.rb:40:in call'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:638:inraw_execute'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:616:in execute'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:381:indoubleClick'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/mouse.rb:22:in double_click'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/action_builder.rb:344:inblock in perform'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/action_builder.rb:343:in each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/action_builder.rb:343:inperform'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.11/lib/watir-webdriver/elements/element.rb:150:in `double_click'

Related

RabbitMQ' pika handshaking fails when SSL is set

I am setting up the SSL layer on RabbitMQ on both server and clients. But the clients are failing when creating the connection to the server. At this point I am running the RabbitMQ server on a docker locally and the client locally using a conda environment.
Once the RabbitMQ server is up I see that the secure connection is accepting incoming connections:
test-rabbitmq-1 | 2023-01-20 08:22:01.692731+00:00 [info] <0.726.0> started TCP listener on [::]:5672
test-rabbitmq-1 | 2023-01-20 08:22:01.694836+00:00 [info] <0.746.0> started TLS (SSL) listener on [::]:7575
But the client refuses to connect with:
(rabbitmq-test) ➜ RabbitMQ-TSL ✗ python3 test.py
Enter PEM pass phrase: ********
INFO:pika.adapters.utils.connection_workflow:Pika version 1.3.1 connecting to ('127.0.0.1', 7575)
INFO:pika.adapters.utils.io_services_utils:Socket connected: <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 43142), raddr=('127.0.0.1', 7575)>
ERROR:pika.adapters.utils.io_services_utils:SSL do_handshake failed: error=SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)'); <ssl.SSLSocket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 43142), raddr=('127.0.0.1', 7575)>
Traceback (most recent call last):
File "/.../.local/lib/python3.10/site-packages/pika/adapters/utils/io_services_utils.py", line 636, in _do_ssl_handshake
self._sock.do_handshake()
File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)
ERROR:pika.adapters.utils.connection_workflow:Attempt to create the streaming transport failed: SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)'); 'localhost'/(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 7575)); ssl=True
ERROR:pika.adapters.utils.connection_workflow:AMQPConnector - reporting failure: AMQPConnectorTransportSetupError: SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)')
ERROR:pika.adapters.utils.connection_workflow:AMQP connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - AMQPConnectorTransportSetupError: SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)'); first exception - None.
ERROR:pika.adapters.utils.connection_workflow:AMQPConnectionWorkflow - reporting failure: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - AMQPConnectorTransportSetupError: SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)'); first exception - None
ERROR:pika.adapters.blocking_connection:Connection workflow failed: AMQPConnectionWorkflowFailed: 1 exceptions in all; last exception - AMQPConnectorTransportSetupError: SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)'); first exception - None
ERROR:pika.adapters.blocking_connection:Error in _create_connection().
Traceback (most recent call last):
File "/.../.local/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
raise self._reap_last_connection_workflow_error(error)
File "/.../.local/lib/python3.10/site-packages/pika/adapters/utils/io_services_utils.py", line 636, in _do_ssl_handshake
self._sock.do_handshake()
File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)
Traceback (most recent call last):
File "/.../test.py", line 16, in <module>
with pika.BlockingConnection(conn_params) as conn:
File "/.../.local/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 360, in __init__
self._impl = self._create_connection(parameters, _impl_class)
File "/.../.local/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
raise self._reap_last_connection_workflow_error(error)
File "/.../.local/lib/python3.10/site-packages/pika/adapters/utils/io_services_utils.py", line 636, in _do_ssl_handshake
self._sock.do_handshake()
File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)
Any idea of what I am not setting properly on pika or at the RabbitMQ server?
On the server side I set the SSL layer at rabbitmq.conf as:
# Enable AMQPS
listeners.ssl.default = 7575
ssl_options.cacertfile = /etc/rabbitmq/cer/ca_certificate.pem
ssl_options.certfile = /etc/rabbitmq/cer/server_certificate.pem
ssl_options.keyfile = /etc/rabbitmq/cer/server_key.pem
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = true
# Enable HTTPS
management.listener.port = 15671
management.listener.ssl = true
management.listener.ssl_opts.cacertfile = /etc/rabbitmq/cer/ca_certificate.pem
management.listener.ssl_opts.certfile = /etc/rabbitmq/cer/server_certificate.pem
management.listener.ssl_opts.keyfile = /etc/rabbitmq/cer/server_key.pem
The docker compose file contains:
version: '3.8'
services:
rabbitmq:
image: rabbitmq:3-management
hostname: rabbitmq-server
volumes:
- ./rabbitmq-config/rabbitmq-cert:/etc/rabbitmq/cer
- ./rabbitmq-config/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
- ./rabbitmq/data:/var/lib/rabbitmq/mnesia/rabbit#my-rabbit
- ./rabbitmq/logs:/var/log/rabbitmq/log
ports:
- 5672:5672
- 7575:7575
- 15672:15672
Then, and to simply, I am using the demo client from RabbitMQ's guide as:
import logging
import pika
import ssl
from pika.credentials import ExternalCredentials
logging.basicConfig(level=logging.INFO)
context = ssl.create_default_context(
cafile = '/rabbitmq-config/rabbitmq-cert/ca_certificate.pem'
)
context.load_cert_chain(
'/rabbitmq-config/rabbitmq-cert/client_certificate.pem',
'/rabbitmq-config/rabbitmq-cert/client_key.pem'
)
ssl_options = pika.SSLOptions(context, "localhost")
conn_params = pika.ConnectionParameters(
port = 7575,
ssl_options = ssl_options,
credentials = ExternalCredentials()
)
with pika.BlockingConnection(conn_params) as conn:
ch = conn.channel()
ch.queue_declare("foobar")
ch.basic_publish("", "foobar", "Hello, world!")
print(ch.basic_get("foobar"))
Your Python code is set up to do X509 certificate authentication (you're not using username/password but are using ExternalCredentials). However, you have not configured RabbitMQ to accept X509 certificates for authentication (docs).
The Pika docs need to be updated, so I opened this issue - https://github.com/pika/pika/issues/1413
You would probably get a hint of this if you look at the RabbitMQ log file at the time your Python client tries to connect.
In order to enable X509 certificate authentication, do the following:
rabbitmq-plugins enable rabbitmq_auth_mechanism_ssl (docs)
Edit your rabbitmq.conf file and add the following section:
auth_mechanisms.1 = PLAIN
auth_mechanisms.1 = AMQPLAIN
auth_mechanisms.1 = EXTERNAL
Restart RabbitMQ
Add a password-less user that exactly matches the CN= value in your client certificate: rabbitmqctl add_user 'foobar, O=baz'. You can also get this value by attempting to connect after making the above changes. The failed auth attempt will be logged.
If you continue to have problems, I suggest asking on the mailing list as this is not a good forum for detailed analysis.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

phpspreadsheets/ phpoffice not working on linux

I have downloaded composer successfully and I am trying to use the phpospreadsheet library but I keep getting these errors although this is a basic code. it works on windows but not on linux.
Code Sample:
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello World !');
$writer = new Xlsx($spreadsheet);
$writer->save('hello world.xlsx');
Errors:
[Tue Oct 05 10:03:34.068348 2021] [php7:warn] [pid 18227] [client 80.247.20.85:62954] PHP Warning: fopen(hello world.xlsx): failed to open stream: Permission denied in /var/www/html/yellow-group.com/public_html/portals/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php on line 111
[Tue Oct 05 10:03:34.074664 2021] [php7:error] [pid 18227] [client 80.247.20.85:62954] PHP Fatal error: Uncaught PhpOffice\\PhpSpreadsheet\\Writer\\Exception: Could not open file "hello world.xlsx" for writing. in /var/www/html/yellow-group.com/public_html/portals/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php:113\nStack trace:\n#0 /var/www/html/yellow-group.com/public_html/portals/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php(504): PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter->openFileHandle('hello world.xls...')\n#1 /var/www/html/yellow-group.com/public_html/portals/test.php(13): PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx->save('hello world.xls...')\n#2 {main}\n thrown in /var/www/html/yellow-group.com/public_html/portals/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php on line 113
the solution was to make a temporary directory. https://github.com/PHPOffice/PhpSpreadsheet/issues/1123
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello World !');
$writer = new Xlsx($spreadsheet);
$path='temp/helloworld.xlsx';
$writer->save($path);

s3cmd failed after try to create a testbucket on ceph-cluster

Hello I am trying to create a testbucket on a Ceph Raspberry Pi cluster(local) and I get the following error message:
OS:Debian Jessie
Ceph: v12.2.12 Luminous
s3cmd:2.0.2
[ceph_deploy.rgw][INFO ] The Ceph Object Gateway (RGW) is now running on host admin and default port 7480
./s3cmd --debug mb s3://testbucket
Debug Message:
DEBUG: Unicodising 'mb' using UTF-8
DEBUG: Unicodising 's3://testbucket' using UTF-8
DEBUG: Command: mb
DEBUG: CreateRequest: resource[uri]=/
DEBUG: Using signature v2
DEBUG: SignHeaders: u'PUT\n\n\n\nx-amz-date:Wed, 15 Jan 2020 02:28:25 +0000\n/testbucket/'
DEBUG: Processing request, please wait...
DEBUG: get_hostname(testbucket): 192.168.178.50:7480
DEBUG: ConnMan.get(): creating new connection: http://192.168.178.50:7480
DEBUG: non-proxied HTTPConnection(192.168.178.50, 7480)
DEBUG: Response:
DEBUG: Unicodising './s3cmd' using UTF-8
DEBUG: Unicodising '--debug' using UTF-8
DEBUG: Unicodising 'mb' using UTF-8
DEBUG: Unicodising 's3://testbucket' using UTF-8
Invoked as: ./s3cmd --debug mb s3://testbucket
Problem: error: [Errno 111] Connection refused
S3cmd: 2.0.2
python: 2.7.17 (default, Oct 19 2019, 23:36:22)
[GCC 9.2.1 20190909]
environment LANG=en_GB.UTF-8
Traceback (most recent call last):
File "./s3cmd", line 3092, in <module>
rc = main()
File "./s3cmd", line 3001, in main
rc = cmd_func(args)
File "./s3cmd", line 237, in cmd_bucket_create
response = s3.bucket_create(uri.bucket(), cfg.bucket_location)
File "/home/cephuser/s3cmd-2.0.2/S3/S3.py", line 398, in bucket_create
response = self.send_request(request)
File "/home/cephuser/s3cmd-2.0.2/S3/S3.py", line 1258, in send_request
conn = ConnMan.get(self.get_hostname(resource['bucket']))
File "/home/cephuser/s3cmd-2.0.2/S3/ConnMan.py", line 253, in get
conn.c.connect()
File "/usr/lib/python2.7/httplib.py", line 831, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
error: [Errno 111] Connection refused
Does anyone know about the error ?
Solution:
Ceph-rgw Service stop automatically after installation
After my gateway was permanently available I could create a testbucket with s3cmd

Flask application Amazon Elastic Beanstalk Cannot be loaded as a python module

I am trying to deploy a flask application to elastic beanstalk and I get a 500 error when I try to access it. I get the following trace from the error log:
mod_wsgi (pid=19748): Target WSGI script '/opt/python/current/app/application.py' cannot be loaded as Python module.
[Sat Jun 30 20:39:26.160095 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] mod_wsgi (pid=19748): Exception occurred processing WSGI script '/opt/python/current/app/application.py'.
[Sat Jun 30 20:39:26.160187 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] Traceback (most recent call last):
[Sat Jun 30 20:39:26.160228 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] File "/opt/python/current/app/application.py", line 107, in <module>
[Sat Jun 30 20:39:26.160232 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] #application.route("/signwriteragreement", methods=["POST"])
[Sat Jun 30 20:39:26.160238 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1250, in decorator
[Sat Jun 30 20:39:26.160241 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] self.add_url_rule(rule, endpoint, f, **options)
[Sat Jun 30 20:39:26.160246 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 66, in wrapper_func
[Sat Jun 30 20:39:26.160248 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] return f(self, *args, **kwargs)
[Sat Jun 30 20:39:26.160253 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1221, in add_url_rule
[Sat Jun 30 20:39:26.160256 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] 'existing endpoint function: %s' % endpoint)
[Sat Jun 30 20:39:26.160268 2018] [:error] [pid 19748] [remote 172.31.2.189:31160] AssertionError: View function mapping is overwriting an existing endpoint function: signwriteragreement
My application has the following format:
application.py
config.py
helpers.py
emailsupport.py
models.py
search.py
requirements.txt
/docs
(folders for saving documents)
/static
(static files)
/templates
(templates)
I did remember to call my application variable "application" so that's not the issue.
Here's the beginning of application.py
from flask import Flask, render_template, redirect, url_for, request, session, flash, g, jsonify, render_template_string, send_from_directory, abort, Markup
application = Flask(__name__)
application.secret_key = "xxx"
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy(application)
from itsdangerous import URLSafeTimedSerializer
from flask_wtf.csrf import CSRFProtect
from elasticsearch import Elasticsearch
csrf = CSRFProtect(application)
csrf.init_app(application)
UPLOAD_FOLDER = "/mnt/c/flasktest/repos/flasktestbackup/docs"
SHARED_FOLDER = UPLOAD_FOLDER + "/shared"
application.config["SQLALCHEMY_DATABASE_URI"] = "mysql+pymysql://xxx:xxx#xxx.cc8l5tq11szj.us-east-2.rds.amazonaws.com/xxx"
# ... (some other config stuff)... then
def login_required(f):
#wraps(f)
def decorated_function(*args, **kwargs):
if session.get("user_id") is None:
return redirect("/welcome")
return f(*args, **kwargs)
return decorated_function
#application.route("/signwriteragreement", methods=["POST"])
#login_required
def signwriteragreement():
# rest of function
and at the bottom I have:
if __name__ == '__main__':
application.debug = True
application.run()
Thanks in advance for any help you can give

Express show Cannot GET/ at post function on Nginx

I have this code saved on my Nginx server with Let's Encrypt SSL.
My intention on this code is to be backend server.
app.use(bodyParser.urlencoded({ extended: true }));
app.get('/', function(res, req) {
res.send('GET ROOT');
});
app.post('/', function(res, req) {
res.send('POST ROOT');
});
app.listen(port, () => {
console.log('We are live on ' + port);
});
The code works great on local.
But when I deployed it on remote server, first I request GET example.com/ it returned GET ROOT. Then I did POST example.com/ it returned GET ROOT. It should be POST ROOT.
And this is my server config snippet from sites-available
server {
listen 80 default_server;
listen[::]: 80 default_server;
server_name example.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# some ssh default path
}
The server is successfully propagated with a domain, and I think there is no problem with loading index.html or something with GET function. And I run the js with nodemon at this development phase.
Please advice..
I thought it was about CORS and I put default CORS configuration, but still nothing's changed.
Then I add this post function without a get with a same endpoint.
app.post('/post', (req, res) => {
res.send('POST POST');
});
It returned this result
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /post</pre>
</body>
</html>
For Nginx error log when I do GET and POST request (retrieved from /var/log/nginx/error.log.1 )
2017/10/24 16:27:19 [error] 1667#1667: *14 connect() failed (111: Connection refused) while connecting to upstream, client: 125.163.124.227, server: officially.id, request: "GET $
2017/10/24 20:52:06 [error] 1667#1667: *72 connect() failed (111: Connection refused) while connecting to upstream, client: 94.23.35.126, server: officially.id, request: "GET / H$
2017/10/24 21:43:26 [notice] 2556#2556: signal process started
2017/10/24 21:48:01 [error] 2758#2758: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 114.124.167.30, server: officially.id, request: "GET /t$
2017/10/24 21:57:04 [notice] 2877#2877: signal process started
2017/10/24 22:00:30 [emerg] 2919#2919: invalid value "=" in /etc/nginx/sites-enabled/default:53
2017/10/24 22:00:39 [emerg] 2924#2924: invalid value "=" in /etc/nginx/sites-enabled/default:53
2017/10/24 22:10:15 [notice] 3060#3060: signal process started
2017/10/25 03:34:42 [error] 3063#3063: *36 connect() failed (111: Connection refused) while connecting to upstream, client: 71.6.202.198, server: officially.id, request: "GET /xx$
When I tried to capture my app.js error and output, nothing is written there except string logged at app.listen(...).

Resources