Error when I try order service from master region

Hello,
I have an error when I order a service from the master region. I have two miq, which are linked, as a master region and a sub region. The service was created in the sub-region and order service from the sub-region the is executed without error, but when I try to order the same service from the region master, I get an error: undefined method `remote_ws_url’ for nil:NilClass. Maybe somebody helps me with it?
Best regards

Interesting. We look at the object you’re trying to perform an action on, in this case the service, to determine the target region and the API endpoint for that region so the request can pass through there. In this case, your service in the subregion/remote is not in the same region as the master/global region you’re trying it from. Therefore, it tries to check the remote region’s remote_ws_url and it fails because the region is not found.

So, can you check a few things:

  1. Can you review the contents of the miq_regions table in the global/master region database.
  2. You’ll need to find the name of the service that failed in the logs and look for it’s table id. This table id should match the region number where the region number of the regions found in 1) is the prefix of the service’s id.

For some reason, it sounds like either the miq_regions table isn’t being replicated over, or the service you’re trying to order is in a region that is not replicating. Is it possible you had a problem with one region and took it down but didn’t remove an old service?

Thank you, for help!

I follow you recommendation and it’s look like replication database from sub-region to master region doesn’t work.

  1. I have only one row in the master region database in the table of the miq_region and its master region (Region 99)

  2. I found in logs service in the master region what the service use id remote region (Region 1)

Could you tell me how to check/configure replication?

In the settings master region in Replication I set type Global and added subscription for database sub-region.

In the settings sub-region in Replication I set type Remote.

What version are you using?

Have you configured the remote first?
See the section Configuring a Remote Copy here.

If all of that was already done, you can try looking at the logs on the remote and global region databases. I can’t remember the log location but you should be able to get it by running these queries on the databases:

show log_directory;
show data_directory;

The first might not be a fully qualified path, such as log so you might need to run the second query to know where the directory is.

It’s possible you are getting failures with your subscriptions.

For example, you need:

logical wal_level

And the max_worker_processes needs to be large enough for the additional processes for replication.

You may also need:

Don’t make any changes before looking at the logs. I know postgreql will complain if for example, your max_worker_processes isn’t large enough. Only make changes that are needed as per the logs and always make backups of your configuration.

Thanks for the help.
It seems I have configured replication between regions, now in the master region in the miq_regions table I have two rows, a local region id and a remote id. But when ordering a service from the master region, I now get a new error: There was an error adding to shopping cart: Invalid System Authentication Token specified. Could you help me for this problem?