Read permission error when adding disk Image to the Images Collection - google-compute-engine

I'm trying to create and use custom images following this guide and I get an error.
$ gcutil --project=es-cloud addimage elasticsearch-0-90-2 gs://esimage/e4686d7f5bf904a924ae0cfeb58d0827c6d5b966.image.tar.gz --preferred_kernel=projects/google/global/kernels/gce-v20130603
It gives:
INFO: Waiting for insert of image elasticsearch-0-90-2. Sleeping for 3s.
+---------------------+-------------------------------------------------+
| property | value |
+---------------------+-------------------------------------------------+
| name | operation-1372347522289-4e0248e924631-f9512254 |
| region | |
| zone | |
| creation-time | |
| status | DONE |
| progress | 100 |
| status-message | |
| target | elasticsearch-0-90-2 |
| target-id | |
| client-operation-id | |
| insert-time | 2013-06-27T08:38:42.289-07:00 |
| user | 338179480470#project.gserviceaccount.com |
| start-time | 2013-06-27T08:38:42.346-07:00 |
| end-time | |
| operation-type | insert |
| error-code | 403 |
| error-message | FORBIDDEN |
| warning | |
| warning-message | |
| | |
| errors | |
| | |
| error | PERMISSIONS_ERROR |
| message | Required 'read' permission for 'rawDisk.source' |
+---------------------+-------------------------------------------------+
I don't understand the error message.
I can read my disk using:
$ gsutil ls gs://esimage
gives
gs://esimage/e4686d7f5bf904a924ae0cfeb58d0827c6d5b966.image.tar.gz
I'm using gcutil 1.8.1.
Did I miss to add a permission somewhere?
Thanks for your help.

Found the issue. I was launching this command from a Google Compute Engine instead of my local machine as stated in documentation.

Related

How to remove duplicate product with same product ID in Woocommerce?

I updated the database. After the update I was faced with duplicate products in Woocommerce -- even though I didn't have duplicate products in database.
I deleted the transient but it's not fixed. I'd appreciate it if you guide me on how to fix it.
Thanks in advance.
The below block shows the list of active plugins
+------------------------------------------------+--------+------------------------------+----------+
| name | status | update | version |
+------------------------------------------------+--------+------------------------------+----------+
| wc-abandoned-carts-by-small-fish-analytics | active | none | 2.6.2 |
| admin-menu-search | active | none | 1.2 |
| woo-advanced-shipment-tracking | active | available | 3.1.4 |
| woo-auto-coupons | active | none | 1.3.2 |
| better-search-replace | active | none | 1.3.3 |
| bookly-responsive-appointment-booking-tool | active | none | 18.9 |
| bookly-addon-pro | active | none | 3.1 |
| code-snippets | active | none | 2.14.0 |
| commercegurus-commercekit | active | none | 1.1.7 |
| customizer-export-import | active | none | 0.9.2 |
| delete-duplicate-posts | active | none | 4.4.7 |
| elementor | active | none | 3.0.13 |
| elementor-pro | active | available | 3.0.5 |
| essential-addons-for-elementor-lite | active | none | 4.3.6 |
| essential-addons-elementor | active | available | 4.2.1 |
| export-import-menus | active | none | 1.6.0 |
| facebook-for-woocommerce | active | available | 1.9.11 |
| kliken-marketing-for-google | active | none | 1.0.6 |
| jet-engine | active | available | 2.5.2 |
| kirki | active | none | 3.1.5 |
| mailchimp-for-woocommerce | active | none | 2.4.7 |
| one-click-demo-import | active | none | 2.6.1 |
| payment-gateways-by-user-roles-for-woocommerce | active | none | 1.2.3 |
| seo-by-rank-math | active | available | 1.0.52.1 |
| redux-framework | active | available | 4.1.21 |
| google-site-kit | active | none | 1.20.0 |
| smart-variations-images-premium | active | none | 4.0.75 |
| string-locator | active | none | 2.4.1 |
| analogwp-templates | active | none | 1.7.5 |
| transients-manager | active | none | 1.8.1 |
| updraftplus | active | available | 1.16.29 |
| woo-variation-swatches | active | available | 1.1.0 |
| woocommerce | active | none | 4.7.0 |
| woocommerce-advanced-bulk-edit | active | none | 4.5 |
| advanced-product-labels-for-woocommerce | active | available | 1.1.16.4 |
| woocommerce-attribute-images | active | none | 1.2.0 |
| woocommerce-brands | active | none | 1.6.10 |
| woocommerce-composite-products2 | active | none | 7.1.1 |
| woocommerce-currency-converter-widget | active | none | 1.6.23 |
| woocommerce-email-test | active | version higher than expected | 2.1 |
| order-emails-log-for-woocommerce | active | version higher than expected | 2.0 |
| woocommerce-order-status-manager | active | none | 1.9.2 |
| woocommerce-product-bundles | active | none | 6.4.0 |
| woocommerce-sequential-order-numbers | active | none | 1.9.5 |
| woocommerce-gateway-stripe | active | none | 4.5.5 |
| weight-based-shipping-for-woocommerce | active | none | 5.3.7 |
| wordpress-importer | active | none | 0.7 |
| xforwoocommerce | active | none | 1.2.8 |
| yith-woocommerce-pre-order-premium | active | none | 1.5.9 |
+------------------------------------------------+--------+------------------------------+----------+
Also I found I have duplicate product on category page with different price while they have same price in inner pages!
In fact I had two issue. the first issue was duplicate product in product list page, that I figured it out the issue relate the some codes like this:
add_filter('posts_clauses', 'order_by_stock_status');
function order_by_stock_status($posts_clauses) {
global $wpdb;
// only change query on WooCommerce loops
if ( is_woocommerce() && (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy())) {
$posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
$posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
$posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
}
return $posts_clauses;
}
I added the !is_admin() to conditions, then It fixed.
Also I had another same issue but this time in categories page. For this case I checked plugins and I figured it out the xforwoocommerce (filter) plugin makes duplicate product with different pricing! :| ( I don't know why! )
I disabled it and it fixed, but I think the root cause is the above code.
Thanks from #benjamin, #grégory-c and #Mtxz!

How to grant read-only (non-copy) access to an object in another process in Cython?

How to grant read-only (non-copy) access to an object in one process to another process?
For example, in the diagram below, how to grant Process 2 and Process 3 access to the class Tasks which is in Process 1?
Process 1 is the only process which will write to the class Tasks and it is not important to maintain any state about which tasks have been processed etc.
Process 2 Process 1 Process 3
+-------------------+ +-------------------+ +-------------------+
| | | | | |
| Perform job A for | <----------+ class Tasks +-----------> | Perform job B for |
| task in Tasks | | | | task in Tasks |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
+-------------------+ +-------------------+ +-------------------+
I think this tasks may involve using pointers? Cython's documentation is brief on parallelism.
How to give Process 2 and Process 3 read-only, non-copy access to the class Tasks which is in Process 1?

Why MySQL Group Replication slave nodes have high delay with write node?

MySQL 5.7.17 MGR deploy in single-primary mode, 3 node all one one machine, the same configuration.
And then we test insert on the primary node and observe that the slave nodes have high delay with the write node, even primary node finish the insert test, slave node data is incresing!
Why MySQL Group Replication slave nodes have high delay with write node?
here is the my.cnf:
[mysqld]
datadir=/dba/mysql/data/s1
basedir=/dba/mysql/mysql-5.7/
port=24801
socket=/dba/mysql/data/s1/s1.sock
server_id=1
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
log_bin=binlog
binlog_format=ROW
transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
loose-group_replication_start_on_boot=off
loose-group_replication_local_address= "127.0.0.1:24901"
loose-group_replication_group_seeds= "127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"
loose-group_replication_bootstrap_group= off
loose-group_replication_single_primary_mode=true
loose-group_replication_enforce_update_everywhere_checks=false
slave_parallel_type=LOGICAL_CLOCK
slave_preserve_commit_order=1
slave_parallel_workers=4
and the MGR config :
mysql> show variables like '%group_replication%';
+----------------------------------------------------+-------------------------------------------------+
| Variable_name | Value |
+----------------------------------------------------+-------------------------------------------------+
| group_replication_allow_local_disjoint_gtids_join | OFF |
| group_replication_allow_local_lower_version_join | OFF |
| group_replication_auto_increment_increment | 7 |
| group_replication_bootstrap_group | OFF |
| group_replication_components_stop_timeout | 31536000 |
| group_replication_compression_threshold | 1000000 |
| group_replication_enforce_update_everywhere_checks | OFF |
| group_replication_flow_control_applier_threshold | 25000 |
| group_replication_flow_control_certifier_threshold | 25000 |
| group_replication_flow_control_mode | QUOTA |
| group_replication_force_members | |
| group_replication_group_name | aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| group_replication_group_seeds | 127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903 |
| group_replication_gtid_assignment_block_size | 1000000 |
| group_replication_ip_whitelist | AUTOMATIC |
| group_replication_local_address | 127.0.0.1:24901 |
| group_replication_poll_spin_loops | 0 |
| group_replication_recovery_complete_at | TRANSACTIONS_APPLIED |
| group_replication_recovery_reconnect_interval | 60 |
| group_replication_recovery_retry_count | 10 |
| group_replication_recovery_ssl_ca | |
| group_replication_recovery_ssl_capath | |
| group_replication_recovery_ssl_cert | |
| group_replication_recovery_ssl_cipher | |
| group_replication_recovery_ssl_crl | |
| group_replication_recovery_ssl_crlpath | |
| group_replication_recovery_ssl_key | |
| group_replication_recovery_ssl_verify_server_cert | OFF |
| group_replication_recovery_use_ssl | OFF |
| group_replication_single_primary_mode | ON |
| group_replication_ssl_mode | DISABLED |
| group_replication_start_on_boot | OFF |
+----------------------------------------------------+-------------------------------------------------+
32 rows in set (0.01 sec)

How does MySQL know when connection is "over"?

I have just closed a MySQL shell by clicking x on my command prompt and I am now curious what happens to database connections when you close the window.
I know that the MySQL server runs on port 3306. If I understand correctly, the server waits for connection requests and passes them to a new thread/available thread for managing the connection.
How does the server know when the connection has been terminated, so that the thread can be released or put back into a pool of available threads?
Scenarios such as:
Blue Screen during a connection with a MySQL server on a remote connection.
Program terminated before it could call a disconnect request.
From the mysql client:
show processlist;
+-----+------+-----------------+---------------+---------+-------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+---------------+---------+-------+-------+------------------+
| 2 | root | localhost:6509 | so_gibberish2 | Sleep | 105 | | NULL |
| 3 | root | localhost:6510 | so_gibberish2 | Sleep | 105 | | NULL |
| 820 | root | localhost:40286 | stackoverflow | Sleep | 13457 | | NULL |
| 821 | root | localhost:40287 | stackoverflow | Sleep | 966 | | NULL |
| 827 | root | localhost:42254 | so_gibberish2 | Query | 0 | init | show processlist |
| 831 | root | localhost:44036 | stackoverflow | Sleep | 230 | | NULL |
+-----+------+-----------------+---------------+---------+-------+-------+------------------+
select connection_id();
+-----------------+
| connection_id() |
+-----------------+
| 827 |
+-----------------+
Now hit [x] as you say to client the mysql client that ran the above.
Below is from Mysql Workbench:
show processlist;
+-----+------+-----------------+---------------+---------+-------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+---------------+---------+-------+-------+------------------+
| 2 | root | localhost:6509 | so_gibberish2 | Sleep | 105 | | NULL |
| 3 | root | localhost:6510 | so_gibberish2 | Sleep | 105 | | NULL |
| 820 | root | localhost:40286 | stackoverflow | Sleep | 13457 | | NULL |
| 821 | root | localhost:40287 | stackoverflow | Sleep | 966 | | NULL |
+-----+------+-----------------+---------------+---------+-------+-------+------------------+
select connection_id();
+-----------------+
| connection_id() |
+-----------------+
| 3 |
+-----------------+
So the closing of a program naturally closes any open sockets it has.
Honestly, the latter output looks more like:
But I always use the mysql client for output formatting for tables which would throw off the results. So there you have it as an image.

Nova boot error Devstack

I uploaded an image to glance, an Ubuntu server 12.04 in a vhd format and when i'm trying to boot that image with nova boot i receive this:
+-------------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000004 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | PK2mwUZ7SJEH |
| config_drive | |
| created | 2012-12-19T17:21:48Z |
| flavor | m1.tiny |
| hostId | |
| id | 716c9276-648c-4f90-9e67-43b8f41feb91 |
| image | Ubuntu |
| key_name | key1 |
| metadata | {} |
| name | vm1 |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| tenant_id | 73e54a9f1ddc46fa9bd0a99d5e2a1cda |
| updated | 2012-12-19T17:21:54Z |
| user_id | dc9c0376d5604467b3898082fd270b1c |
+-------------------------------------+--------------------------------------+
ubuntu#ubuntu:~/vmware-tools-distrib$ cd /
ubuntu#ubuntu:/$ cd /home/ubuntu/devstack/
ubuntu#ubuntu:~/devstack$ nova list
+--------------------------------------+------+--------+----------+
| ID | Name | Status | Networks |
+--------------------------------------+------+--------+----------+
| 716c9276-648c-4f90-9e67-43b8f41feb91 | vm1 | ERROR | |
| 77aa0d77-2dae-4d18-a827-f08d0fb2f71a | vm1 | ERROR | |
+--------------------------------------+------+--------+----------+
So, what may be the problem??
Thanks!
you can access the database to get the detail reason if there is no obvious information in log file, query nova.instance_faults table will give you more information about why this instance became error status.
look at the nova-network.log if there is an error which is related dhcpbridge file, add that line to nova.conf
dhcpbridge = /usr/bin/nova-dhcpbridge
hint: if there is a builted image(nova list) delete it and then restart all nova-* services