Domain deletion error in plesk - iis

Guyzz, When I am trying to delete a domain from plesk(11.5_windows), I am getting an error. Pasting error below:
Error: DNSZone::Table::select() failed: no such row in the table
Do you ever got this error ?

Guyzz,
Finally I got a solution. The reason for the error is that in psa.domains, the Plesk MySQL table dns_zone_id record points to a nonexistent ID record in the psa.dns_zone table for one or several domains.
Resolution is explaining below :
As a first step, delete domain which having issue from IIS then follow the steps below.
Access the plesk's DB (psa), for that follow the steps below :
--> cmd >> cd %plesk_dir%\mysql\bin
--> type mysql.exe -u admin -p -P 8306 psa
--> type plesk's password
Find the domains that have missing IDs by running following query :
SELECT d.name FROM domains d LEFT JOIN dns_zone z ON d.dns_zone_id=z.id WHERE z.id IS NULL;
Create appropriate ID records using the following commands. Do not forget to replace <"DOMAIN-NAME"> with the real domain name and <"ADMIN-EMAIL"> with the correct email:
INSERT INTO dns_zone (name, displayName, email) VALUES ('<DOMAIN-NAME>', '<DOMAIN-NAME>', '<ADMIN-EMAIL>');
Determine the new zone ID:
SELECT id, name FROM dns_zone where name='<DOMAIN-NAME>';
Substitute the correct ID into the psa.domains table, remembering to replace <"DOMAIN-NAME"> and <"DNS-ZONE-ID"> with the correct values:
UPDATE domains SET dns_zone_id='<DNS-ZONE-ID>' WHERE name='<DOMAIN-NAME>';
Thats it !!! Now you should able to delete the domain from plesk !!!

Related

Not getting results from IHP DataSync despite setting Row Level Policy

I want to use DataSync on my current application, using IHP 0.16. I believe I have followed all the installation steps in FrontController and Routes.
I have a characters table with a user_id column connected to the users table. I have set the policy on the characters table resulting in this generated SQL:
CREATE POLICY "Users can manage their characters" ON characters USING (user_id = ihp_user_id()) WITH CHECK (user_id = ihp_user_id());
ALTER TABLE characters ENABLE ROW LEVEL SECURITY;
Trying to run this in the JavaScript console
await query("characters").fetch()
I get this error in JavaScript output:
And this error in IHP output:
Query (2.119753ms): "SELECT relrowsecurity FROM pg_class WHERE oid = ?::regclass" ["characters"]
Query (0.111442ms): "SET LOCAL ROLE ?" [Identifier {fromIdentifier = "ihp_authenticated"}]
Query (0.130888ms): "SET LOCAL rls.ihp_user_id = ?" Only {fromOnly = Just 0d7b46b1-bcb4-46a2-bf77-ad27dace8416}
FormatError {fmtMessage = "1 single '?' characters, but 3 parameters", fmtQuery = "SELECT ? FROM ??", fmtParams = ["*","characters",""]}
This seems to be another error than the row level security error in the DataSync tutorial in the IHP docs. Any idea on what causes this error?
This is a known bug in IHP v0.16.0. It's already fixed in master
It's best to use IHP DataSync with the version mentioned in the introduction text at https://ihp.digitallyinduced.com/Guide/realtime-spas.html :)
There's btw a workaround for the bug if you don't want to upgrade: You always need to specify an order by, like await query("characters").orderBy('createdAt').fetch()

How to set a `User cap` for a particular domain in Gitlab

Original question:
I want to limit the number of users from a particular domain that can register into my Gitlab instance. I noticed that I could set a "user cap", but it wasn't specific to a domain.
For example:
I want to limit the number of users registered from these domains. 20 users from testdomain1.com and 30 users from testdomain2.com are allowed to sign up. So, if there are already 20 users registered sucessfully from testdomain1.com, new user from testdomain1.com will not be allowed to sign up.
What should I do for it?
2021.11.18 Edited:
I added a validate to the User model:
# gitlab/app/models/user.rb
class User < ApplicationRecord
# ...
validate :email_domain, :ensure_user_email_count
# ...
def email_domain
email_domain = /\#.*?$/.match(email)[0]
email_domain
end
def ensure_user_email_count
# select count(*) from users where email like '%#test.com';
if User.where("email LIKE ?", "%#{email_domain}" ).count >= 30
errors.add(email_domain, _('already has 30 registered email.'))
end
end
end
This validate can set "user cap = 30" for each domain but it's still not able to set a "User cap" for a particular domain.
Since the related issue post did not get any response yet. I'm tring to implement it by myself. And it seems like that I need to extend the UI of the Admin Settings page and add some related tables to database to set different "user cap" for different email domain.
The GitLab user cap seems to be per GitLab instance.
So if both your domains are reference the same GitLab instance, you would have only one user cap possible.
But if each of your domain redirects to one autonomous GitLab instance (per domain), then you should be able to set user cap per domain.
The OP Ann Lin has created the issue 345557 to follow that feature request.
TRhe OP reports:
A particular table is needed to store the caps.
But I don’t have enough time now to modify the UI so I found a simple way to do this:
The Allowed domains for sign-ups which called domain_allowlist in database is a text:
gitlabhq_production=# \d application_settings
...
domain_allowlist | text | | |
...
gitlabhq_production=# select domain_allowlist from >application_settings;
domain_allowlist
-------------------
--- +
- testdomain1.com+
- testdomain2.com+
(1 row)
I can modify the testdomain1.com to testdomain1.com#30 to store the user cap and use Regex to get the number 30.
I will modify the UI and add the database table later. And I’ll create a pull request on Gitlab when I’m done.

Unable to select from SQL Database tables using node-ibm_db

I created a new table in the Bluemix SQL Database service by uploading a csv (baseball.csv) and took the default table name of "baseball".
I created a simple app in Node.js which is just trying to select data from the table with select * from baseball, but I keep getting the following error:
[IBM][CLI Driver][DB2/NT] SQL0204N "USERxxxx.BASEBALL" in an undefined name
Why can't it find my database table?
This issue seems independent of bluemix, rather it is usage error.
This error is possibly caused by following:
The object identified by name is not defined in the database.
User response
Ensure that the object name (including any required qualifiers) is correctly specified in the SQL statement and it exists.
try running "list tables" from command prompt to check if your table spelling is correct or not.
http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.messages.sql.doc/doc/msql00204n.html?cp=SSEPGG_9.7.0%2F2-6-27-0-130
I created the table from SQL Database web UI in bluemix and took the default name of baseball. It looks like this creates a case-sensitive table name.
Unfortunately for me, the sql_db libary (and all db2 clients I believe) auto-capitalizes the SQL query into "SELECT * FROM BASEBALL"
The solution was to either
A. Explicitly name my table BASEBALL in the web UI; or
B. Modify my sql query by quoting the table name:
select * from "baseball"
More info at http://www.ibm.com/developerworks/data/library/techarticle/0203adamache/0203adamache.html#N10121

Error while assigning Users to an Organization: com.liferay.portal.NoSuchResourceActionException

I am getting following error while assiging users to organization using UserServiceUtil.addOrganizationUsers(orgId, userIds)
ERROR [AdvancedPermissionChecker:944]
com.liferay.portal.NoSuchResourceActionException:
com.liferay.portal.model.Organization#ASSIGN_MEMBERS
I guess I need to add a row in Resource Table with com.liferay.portal.model.Organization name and ASSIGN_MEMBERS in actionID. But what to insert in resourceActionId and bitwiseValue fields.
or Is there any other way to get rid of this error?
fresh installation of Liferay 6.1.1 ga 2 resolved this issue for me.

ldap queries for an OU in knowing tree structure

I 'm trying 2 things in an tool called Itop on a Centos desktop.
I post here because it's about general ldap queries. I'm trying my queries with ldap explore and Itop.
1.import several users from an OU but it's not working.
My ldap query maybe isn't good:
(&(objectCategory=organizationalUnit)(memberOf=CN=Organizational-Unit,CN=Schema,CN=Configuration,DC=mydomain,DC=local))
or
(&(objectCategory=user)(memberOf=OU=Users,OU=Informatique,OU=Administration,DC=mydomain,DC=local))
knowing that my tree structure is like that:
DC=mydomain,DC=local => OU=Administration => OU=Informatique, OU=Users
2.import a specific user:
(objectcategory=user)((cn=seb))
The query is working but I have an error in Itop perhaps a field missed:
error:
An error occured while processing 1: Object not following integrity rules: issues = Unexpected value for attribute 'name': Null not allowed, Unexpected value for attribute 'email': Wrong format [seb#mydomain.local], class = Person, id =
How resolve that? with which queries?
Thanks,
seta
I can try to help you with the query. The (memberOf=parameter) filter is for groups, not OUs. An LDAP query has three components: base, filter, and scope. If you want all the users in your OU, then you need to set
base to the OU's distinguished name
OU=Users,OU=Informatique,OU=Administration,DC=mydomain,DC=local
filter to get only users
(objectCategory=user)
scope to Subtree (or OneLevel if you don't want to search the OU's underneath the target OU).

Resources