satchmo no such table - django-models

When ever i goto the admin and click i on any of the satchmo links i get
DatabaseError at /admin/product/category/
no such table: product_category
Request Method: GET
Request URL: url.com/admin/product/category/
Django Version: 1.3.1
Exception Type: DatabaseError
Exception Value:
no such table: product_category
Exception Location: /usr/local/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/backends/sqlite3/base.py in execute, line 234
Python Executable: /usr/bin/python
Python Version: 2.6.5
category can be substituted with anything satchmo in the admim, such as, product, discounts, etc. all same error. this is a fresh satchmo package build using clonesatchmo.py.

Related

DBMS_JAVA could not be validated or authorized

I am facing the error while upgrading oracle database 11gR2 to 19c.
Error Code: ORA-04023: Object SYS.DBMS_JAVA could not be validated or authorized.
For example:
SQL> select dbms_java.longname('TEST') from dual;
select dbms_java.longname('TEST') from dual
*
ERROR at line 1:
ORA-04023: Object SYS.DBMS_JAVA could not be validated or authorized
Using dba_registry should help identify if there is something wrong with your Java version installed in the database.
Query
SELECT comp_id, comp_name, version, version_full, status, procedure
FROM dba_registry
WHERE comp_id = 'JAVAVM';
Example Result
COMP_ID COMP_NAME VERSION VERSION_FULL STATUS PROCEDURE
__________ _______________________________ _____________ _______________ _________ _____________________________
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 19.10.0.0.0 VALID INITJVMAUX.VALIDATE_JAVAVM
When looking at dba_registry, any components that are not listed as VALID can be validated by connecting as SYS then running the procedure listed under the PROCEDURE column.

Prisma Schema not updating properly after adding new fields

As the title states, I am using Prisma 2 in a Next JS app. I have a very simple schema:
model User {
id Int #id #default(autoincrement())
firstName String
middleName String?
firstLastname String
secondLastname String?
email String
role String
group Group? #relation(fields: [groupId], references: [id])
groupId Int?
activity Activity? #relation(fields: [activityId], references: [id])
activityId Int?
createdOn DateTime #default(now())
updatedOn DateTime #default(now())
}
model JobTitle {
id Int #id #default(autoincrement())
name String
createdOn DateTime #default(now())
updatedOn DateTime #default(now())
}
model Group {
id Int #id #default(autoincrement())
name String
users User[]
createdOn DateTime #default(now())
updatedOn DateTime #default(now())
}
model Activity {
id Int #id #default(autoincrement())
name String
users User[]
}
I added the email field on the User model and changed the groupId and activityId fields to be optional. I also changed the type for the role field to String. I run prisma migrate and prisma up to create a new migration and sync the database (using a remote heroku postgresql database as my datasource) and everything runs fine. No errors. However, when I try to create a new User, I get the following error:
An error ocurred: PrismaClientValidationError:
Invalid `prisma.user.create()` invocation:
{
data: {
firstName: 'John',
middleName: 'Edgar',
firstLastname: 'Doe',
secondLastname: 'Smith',
email: 'john#email.com',
~~~~~
role: 'ADMIN',
~~~~~~~
+ group: {
+ create?: GroupCreateWithoutUsersInput,
+ connect?: GroupWhereUniqueInput,
+ connectOrCreate?: GroupCreateOrConnectWithoutusersInput
+ },
+ activity: {
+ create?: ActivityCreateWithoutUsersInput,
+ connect?: ActivityWhereUniqueInput,
+ connectOrCreate?: ActivityCreateOrConnectWithoutusersInput
+ },
? createdOn?: DateTime,
? updatedOn?: DateTime
}
}
Unknown arg `email` in data.email for type UserCreateInput. Did you mean `role`?
Argument role: Got invalid value 'ADMIN' on prisma.createOneUser. Provided String, expected RoleCreateOneWithoutUserInput:
type RoleCreateOneWithoutUserInput {
create?: RoleCreateWithoutUserInput
connect?: RoleWhereUniqueInput
connectOrCreate?: RoleCreateOrConnectWithoutUserInput
}
Argument group for data.group is missing.
Argument activity for data.activity is missing.
Note: Lines with + are required, lines with ? are optional.
at Document.validate (C:\Users\user\Documents\projects\employee-evaluation-app\employee-evaluation-app\node_modules\#prisma\client\runtime\index.js:77411:19)
at NewPrismaClient._executeRequest (C:\Users\user\Documents\projects\employee-evaluation-app\employee-evaluation-app\node_modules\#prisma\client\runtime\index.js:79063:17)
at C:\Users\user\Documents\projects\employee-evaluation-app\employee-evaluation-app\node_modules\#prisma\client\runtime\index.js:79000:52
at AsyncResource.runInAsyncScope (node:async_hooks:197:9)
at NewPrismaClient._request (C:\Users\user\Documents\projects\employee-evaluation-app\employee-evaluation-app\node_modules\#prisma\client\runtime\index.js:79000:25)
at Object.then (C:\Users\user\Documents\projects\employee-evaluation-app\employee-evaluation-app\node_modules\#prisma\client\runtime\index.js:79117:39)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:93:5) {
clientVersion: '2.12.0'
}
It seems like the operation is using a previous version of the schema seeing as how it says that the email field does not exist and the role field is not a String type. Also, the groupId and activityId fields are still shown as required. I don't know if there some sort of cache. I already tried deleting all migrations and redeploying everything from scratch. I even deleted the database in heroku and started fresh but I am still getting the same error.
Running an npm install (no need to remove node_modules) and then re generating the Prisma types can fix this issue.
Since npm i removes the old Prisma generations, npx prisma generate will have to generate new ones from your schema.prisma.
Ryan's comment about adding a post install script for Prisma is a nice QOL improvement, too.
Edit:
Closing and opening your editor (in my case VsCode) will fix the red line errors. I think the extension struggles to update itself with the new changes. It's a pain but does work if the other solutions don't.
To fix this in VS Code after running npx prisma migrate dev or npx prisma db push, you can try one of these following methods:
Reloading VS Code (Just simply close and reopen VS Code)
Restart VS Code language server (Hit Ctrl + Shift + P, then search for Restart TS server)
Two method above will take a few minute to get VS Code working again, so I recommend this way:
Open file node_modules\.prisma\client\index.d.ts to get VS Code re-indexing this file (because it's too large, VS Code does not reload this file ), then it'll work in few seconds.
I had something closer to this problem. In my case, I updated my Schema.prisma with new models but anytime I run "prisma migrate dev", it wouldn't update. It turns out the error was because I didn't hit "Save" after making the changes before running the code. (In my defence, I thought auto-save took care of that but no).
Try saving the file again before you run "prisma migrate dev".
you can update it in migrations.sql file and run prisma migrate dev. that'll work.

Use Flink to call arangodb Java driver API to insert data into arangodb and report error err 'transaction ID already used'

Use Flink to call arangodb Java driver API to insert data into arangodb and report error err 'transaction ID already used'
Caused by: TimerException{com.arangodb.ArangoDBException: Response: 500, Error: 1590 - AQL: error, cluster node: 'PRMR-c338134b-023c-438d-b672-d5f954c2882c', endpoint: 'tcp://192.168.2.137:8530', error: 'transaction ID already used' (while optimizing plan)}
at org.apache.flink.streaming.runtime.tasks.SystemProcessingTimeService$TriggerTask.run(SystemProcessingTimeService.java:284)
... 7 more
Caused by: com.arangodb.ArangoDBException: Response: 500, Error: 1590 - AQL: error, cluster node: 'PRMR-c338134b-023c-438d-b672-d5f954c2882c', endpoint: 'tcp://xxx:8530', error: 'transaction ID already used' (while optimizing plan)
at com.arangodb.internal.util.ResponseUtils.checkError(ResponseUtils.java:53)
at com.arangodb.internal.velocystream.VstCommunication.checkError(VstCommunication.java:149)
at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:128)
at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:42)
at com.arangodb.internal.velocystream.VstCommunication.execute(VstCommunication.java:132)
at com.arangodb.internal.velocystream.VstProtocol.execute(VstProtocol.java:47)
at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:71)
at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:53)
This seems to be a bug in arangodb and should be resolved in later versions.

Apache Drill - SQL Server plugin does not 'Show Tables'

Using Apache Drill,
I successfully created new plugin : mssql
Configuration:
{
type: "jdbc",
driver: "com.microsoft.sqlserver.jdbc.SQLServerDriver",
url: "jdbc:sqlserver://99.99.99.999:1433;databaseName=ABC",
username: "abcuser",
password: "abcuser",
enabled: true
}
But when i try to query again a table I get an error:
select * from mssql.ABC.dbo.TableName
Error:
org.apache.drill.common.exceptions.UserRemoteException: VALIDATION ERROR: From line 1, column 15 to line 1, column 19: Table 'mssql.ABC.dbo.TableName' not found SQL Query null [Error Id: feba9fdb-1621-438a-9d7c-304e4252a41f on AA99-9AA9A99.xyz.abc.com:31010]
Even the below command returns no tables:
show tables;
It should be like
select * from mssql.dbo.TableName

django-pyodbc and pervasive database

Hi There is a way to use django-pyodbc with pervasive database ? I try different settings but when I try to inspectdb to create a model from the database it shows me this error but I can create querys in pervasive with python pyodbc.
`('42000', '[42000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC
Engine Interface]Invalid SET statement. (0) (SQLExecDirectW)')
Request Method: GET
Request URL:
Django Version: 1.6.6
Exception Type: ProgrammingError
Exception Value:
('42000', '[42000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface]Invalid SET statement.
(0) (SQLExecDirectW)')
Exception Location: C:\Python27\lib\site-packages\django_pyodbc\base.py in _cursor, line 296
Python Executable: C:\Python27\python.exe
Python Version: 2.7.8
cursor.execute("SET DATEFORMAT Ymd; SET DATEFIRST %s" % self.datefirst)
pyodbc.ProgrammingError: ('42000', '[42000] [Pervasive][ODBC Client Interface][LNA][Pervasive] [ODBC Engine Interface]Invalid SET statement. (0) (SQLExecDirectW)')`
and this is the piece of the error when I try to run inspectdb on the database.
According to the main problem is in this file base.py line 296 is some problem with a set statement on the odbc driver this is piece of the code on base.py I try to comment but after another thing shows up.
`cursor.execute("SET DATEFORMAT Ymd; SET DATEFIRST %s" % self.datefirst)
if self.ops.sql_server_ver < 2005:
self.creation.data_types['TextField'] = 'ntext'
self.features.can_return_id_from_insert = False
ms_sqlncli = re.compile('^((LIB)?SQLN?CLI|LIBMSODBCSQL)')
self.drv_name = self.connection.getinfo(Database.SQL_DRIVER_NAME).upper()
# http://msdn.microsoft.com/en-us/library/ms131686.aspx
if self.ops.sql_server_ver >= 2005 and ms_sqlncli.match(self.drv_name) and self.MARS_Connection:
# How to to activate it: Add 'MARS_Connection': True
# to the DATABASE_OPTIONS dictionary setting
self.features.can_use_chunked_reads = True`
Try put single quote around %s:
cursor.execute("SET DATEFORMAT Ymd; SET DATEFIRST '%s'" % self.datefirst)
Check your access rights. The error message indicates a syntax error but according to mssql support site, error code 42000 is either "Syntax error or access violation".

Resources