SonarQube : cannot insert duplicate key row in object 'dbo.file_sources' with unique index 'file_sources_file_uuid_uniq'. The duplicate key value is - data-migration

during the process migration of Sonar (from 4.5.7 to 5.4), we faced to an issue. The migration failed with this message :
Cannot insert duplicate key row in object 'dbo.file_sources' with uni
que index 'file_sources_file_uuid_uniq'. The duplicate key value is...
My database is an MS SQL Server. She's configured in FRENCH_CI_AS. I tried to change it in FRENCH_CS_AS, but it didn't solve the problem.
I've observed that, each time we restart the migration, the number of processed files was different. BUT it always failed by processing for the same file.
Any idea ?

Related

airflow db init could not find table 'ab_role' with which to generate a foreign key to target column 'id'

Airflow 2.4.3
I dropped and created a new database and issued airflow db init
getting the fllowing error as some few tables are missing,
How can I over come this error
[2022-11-29 14:46:48,449] {migration.py:204} INFO - Context impl MySQLImpl.
[2022-11-29 14:46:48,450] {migration.py:207} INFO - Will assume non-transactional DDL.
.....
...
....
File "/opt/airflow_test/az/airflow_env/lib64/python3.8/site-packages/sqlalchemy/sql/schema.py", line 2373, in column
raise exc.NoReferencedTableError(
sqlalchemy.exc.NoReferencedTableError: Foreign key associated with column 'ab_permission_view_role.role_id' could not find table 'ab_role' with which to generate a foreign key to target column 'id'
getting error in starting the airflow webserver
'ab_permission_view_role.permission_view_id' could not find table 'ab_permission_view'

PYTHON - Delete documents in partition collection in cosmos db

I am new in python scripting and currently developing a piece of code to delete documents in cosmos db .
The script successfully deletes the document in non-partition collection.
When i use the same for partition collection i get 400 error and when i use partition key in options i get 404 resource not found.
1) i use query documents to select the records and write in file as backup
2) taking -self and put it in list
3) iterates the _self and delete using below code which is not working in partition collections
#options['partitionkey']='Ne2214553'
#options['partitionkey']='/name'
for i in lstlength:
item=lst[i]
print('item:',item)
del_itm_cnt=del_itm_cnt+1
client.DeleteDocument(item,options)
what should i have to pass in options, i tried with name of partition key ('/name') and value for partition key ('Ne2214553')
Please help me in this.
You need to set value of partition key like 'Ne2214553' not '/name'.
options = {}
options['partitionKey'] = 'Ne2214553'
client.DeleteDocument("dbs/db/colls/part/docs/1", options)
Above code works for me , you could check the value of item in you code if matches with the value of partition key you provided.

Resource Conflict after syncing with PouchDB

I am new to CouchDB / PouchDB and until now I somehow could manage the start of it all. I am using the couchdb-python library to send initial values to my CouchDB before I start the development of the actual application. Here I have one database with templates of the data I want to include and the actual database of all the data I will use in the application.
couch = couchdb.Server()
templates = couch['templates']
couch.delete('data')
data = couch.create('data')
In Python I have a loop in which I send one value after another to CouchDB:
value = templates['Template01']
value.update({ '_id' : 'Some ID' })
value.update({'Other Attribute': 'Some Value'})
...
data.save(value)
It was working fine the whole time, I needed to run this several times as my data had to be adjusted. After I was satisfied with the results I started to create my application in Javascript. Now I synced PouchDB with the data database and it was also working. However, I found out that I needed to change something in the Python code, so I ran the first python script again, but now I get this error:
couchdb.http.ResourceConflict: (u'conflict', u'Document update conflict.')
I tried to destroy() the pouchDB database data and delete the CouchDB database as well. But I still get this error at this part of the code:
data.save(value)
What I also don't understand is, that a few values are actually passed to the database before this error comes. So some values are saved() into the db.
I read it has something to do with the _rev values of the documents, but I cannot get an answer. Hope someone can help here.

Azure SQL Data Warehouse: No catalog entry found for partition ID <id> in database <id>. The metadata is inconsistent. Run DBCC CHECKDB

I am working on moving stored procedures from an on-prem SQL Server database to an Azure SQL Data Warehouse (ASDW). Throughout the process I have had to work around a few missing features - time consuming but not impossible. One thing I have had to do is replace CTE's followed by MERGE statements with temp tables followed by UPDATE/INSERT/DELETE statements (since CTE's cannot be followed by these statements). At the beginning of each SP I check for the temp tables and delete them if they exist.
Today, I created another stored procedure in the ASDW without any temp tables (no updates/inserts/deletes so I left the CTE's in there), it "compiled", and I was able to run it without issue (returned an empty result set, as there is no data yet). I created another SP after this, and when I went to execute it, I got the following error:
...No catalog entry found for partition ID (id) in database 26. The metadata is inconsistent. Run DBCC CHECKDB to check for a metadata corruption...
I then went back to the first SP that I mentioned, and it gave me the same error, even though it had previously run without flaw.
I tried running DBCC CHECKDB as instructed but alas, it is not supported/doesn't work.
I dug around a lot, and what I ended up doing was scaling my database from 100DWU's to 500DWU's. I am at 0.16% of my database storage size limit, and there is barely any data anywhere (total DB size is <300MB).
Is there an explanation for this? If not, I can't in good conscience use this platform in a production environment.
Full error:
Msg 110802, Level 16, State 1, Line 1
110802;An internal DMS error occurred that caused this operation to fail.
Details: Exception: Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.DmsSqlNativeException,
Message: SqlNativeBufferReader.Run, error in OdbcExecuteQuery: SqlState:
42000, NativeError: 608, 'Error calling: SQLExecDirect(this->GetHstmt(), (SQLWCHAR *)statementText, SQL_NTS), SQL return code: -1 | SQL Error Info:
SrvrMsgState: 1, SrvrSeverity: 16, Error <1>: ErrorMsg: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]No catalog entry found for partition ID
72057594047758336 in database 36. The metadata is inconsistent. Run DBCC
CHECKDB to check for a metadata corruption. | Error calling: pReadConn-
>ExecuteQuery(statementText, bufferFormat) | state: FFFF, number: 134148,
active connections: 100', Connection String: Driver={pdwodbc};APP=TypeC01-
DmsNativeReader:DB196\mpdwsvc (2504)- ODBC;Trusted_Connection=yes;AutoTranslate=no;Server=\\.\pipe\DB.196-
bb5f9dd884cf\sql\query
I'm sorry to hear about your experience with Azure SQL Data Warehouse. I believe this is a defect related to BIT data type handling for NOT NULL columns. Can you confirm that you have a BIT NOT NULL column (e.g., CREATE TABLE t1 (IsTrue BIT NOT NULL);)?
If so, a fix has been coded and is in testing for release. To mitigate this now, you can either switch to a TINY INT or remove the NOT NULL setting for the column.

Foreign Key Reference Error for Azure Data Sync

In My Data Sync Group there have 2 tables . Let say A and B . some columns of A reference to B table. B is Master Table.
When sync occur table A is do the processing ahead of Table B. So I got the Foreign Key Reference Error.
IS Azure Data sync processing with alphabetic order ?
Any solution for this ?
Thz in advance.
As #JuneT suggested, you might want to post this question in the "SQL Azure Forum" (http://aka.ms/sqlazureforum). When you do, they have asked specifically that you include the following information when asking Data Sync related questions:
Server id: Your server id
Region: Where your Data Sync Server is located/created
Time / Date: Date and time when you encountered the issue
Tracing Id: The tracing id you see in the message in UI

Resources