Additional uncaught exception thrown while handling exception.
Original
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal8new.users' doesn't exist: SELECT u.*, s.* FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid; Array ( [:sid] => jTk-DdIj4XlzQsnH86R22ktqje2PUFx7RcfnngiQJJg ) in Drupal\Core\Database\Connection->query() (line 569 of /var/www/drupal8new/core/lib/Drupal/Core/Database/Connection.php).
Drupal\Core\Database\Connection->query('SELECT u.*, s.* FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid', Array)
Drupal\Core\Session\SessionHandler->read('IIBgOUpsx2qnDOPFcwY_1VKaZrjxC48SVzaOOoKEi78')
Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler->read('IIBgOUpsx2qnDOPFcwY_1VKaZrjxC48SVzaOOoKEi78')
Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->read('IIBgOUpsx2qnDOPFcwY_1VKaZrjxC48SVzaOOoKEi78')
session_start()
Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
Drupal\Core\Session\SessionManager->start()
Drupal\Core\Session\SessionManager->initialize()
Drupal\Core\Authentication\Provider\Cookie->authenticate(Object)
Drupal\Core\Authentication\AuthenticationManager->authenticate(Object)
Drupal\Core\Session\AccountProxy->getAccount()
Drupal\Core\Session\AccountProxy->id()
Drupal\Core\Logger\LoggerChannel->log(6, '%module module installed.', Array)
watchdog('system', '%module module installed.', Array, 6)
Drupal\Core\Extension\ModuleHandler->install(Array, )
drupal_install_system(Array)
install_base_system(Array)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal()
Additional
RuntimeException: Failed to start the session: already started by PHP. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 134 of /var/www/drupal8new/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php).
Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
Drupal\Core\Session\SessionManager->start()
Drupal\Core\Session\SessionManager->initialize()
Drupal\Core\Authentication\Provider\Cookie->authenticate(Object)
Drupal\Core\Authentication\AuthenticationManager->authenticate(Object)
Drupal\Core\Session\AccountProxy->getAccount()
Drupal\Core\Session\AccountProxy->id()
Drupal\Core\Logger\LoggerChannel->log(3, '%type: !message in %function (line %line of %file).', Array)
watchdog('php', '%type: !message in %function (line %line of %file).', Array, 3)
_drupal_log_error(Array, 1)
_drupal_exception_handler(Object)
How to fix this erro
Related
I am going through the official Cairo language tutorial. When I get to the build_dict function for the 15-puzzle, I am a bit confused so would like to print out some things to see.
struct Location:
member row : felt
member col : felt
end
...
func finalize_state(dict : DictAccess*, idx) -> (
dict : DictAccess*):
if idx == 0:
return (dict=dict)
end
assert dict.key = idx
assert dict.prev_value = idx - 1
assert dict.new_value = idx - 1
return finalize_state(
dict=dict + DictAccess.SIZE, idx=idx - 1)
end
##### I added the {} along with context in it for output #####
func main{output_ptr : felt*}():
alloc_locals
local loc_tuple : (Location, Location, Location, Location, Location) = (
Location(row=0, col=2),
Location(row=1, col=2),
Location(row=1, col=3),
Location(row=2, col=3),
Location(row=3, col=3),
)
# Get the value of the frame pointer register (fp) so that
# we can use the address of loc_tuple.
let (__fp__, _) = get_fp_and_pc()
# Since the tuple elements are next to each other we can use the
# address of loc_tuple as a pointer to the 5 locations.
verify_location_list(
loc_list=cast(&loc_tuple, Location*), n_steps=4)
##### Here is what I added #####
local locs : Location* = cast(&loc_tuple, Location*)
tempvar loc = [locs]
tempvar row = loc.row
serialize_word(row)
################################
return ()
end
I added the lines for printing the first row in loc_tuple. However, the Cairo compiler is giving me the following errors:
Traceback (most recent call last):
File "/Users/yijiachen/cairo_venv/bin/cairo-compile", line 10, in <module>
sys.exit(main())
File "/Users/yijiachen/cairo_venv/lib/python3.8/site-packages/starkware/cairo/lang/compiler/cairo_compile.py", line 397, in main
cairo_compile_common(
File "/Users/yijiachen/cairo_venv/lib/python3.8/site-packages/starkware/cairo/lang/compiler/cairo_compile.py", line 121, in cairo_compile_common
assembled_program = assemble_func(
File "/Users/yijiachen/cairo_venv/lib/python3.8/site-packages/starkware/cairo/lang/compiler/cairo_compile.py", line 367, in
cairo_assemble_program
check_main_args(program)
File "/Users/yijiachen/cairo_venv/lib/python3.8/site-packages/starkware/cairo/lang/compiler/cairo_compile.py", line 296, in check_main_args
assert main_args == expected_builtin_ptrs, (
AssertionError: Expected main to contain the following arguments (in this order): []. Found: ['output_ptr'].
I have tried with various serialize_word statements and none seem to work. This issue never arose before with other serialize_word statements, including in earlier parts of the tutorial.
Declare %builtins output at the top of your code so that the compiler will know that you use an implicit argument (output_ptr) in your main function and expect it.
The Cairo compiler is able to process implicit arguments only if you declare that you are going to use them. See here.
I use electron/build_tools to build electron and run e init --root=~/electron --bootstrap testing; e debug.(e debug runs local Electron build inside of lldb.)
Set a breakpoint by (lldb) br set --file archive.cc --line 155
Print any variable in this file, eg p header ,p size but return error.
Run frame variable , frame variable -g but no value return.
(lldb) br set --file archive.cc --line 155
(lldb) r
Process 30523 launched: '/Users/electron/src/out/Testing/Electron.app/Contents/MacOS/Electron' (x86_64)
Electron Framework was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 30523 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100352d90 Electron Framework`::Init() at archive.cc:155:63 [opt]
152 }
153
154 base::PickleIterator header_pickle(
-> 155 base::Pickle(reinterpret_cast<const char*>(file_.data() + 8), size));
156 std::string header;
157 if (!header_pickle.ReadString(&header)) {
158 LOG(ERROR) << "Failed to read header string at '" << path_.value() << "'";
Target 0: (Electron) stopped.
(lldb) frame variable
(lldb) p file_
error: <user expression 21>:1:1: use of undeclared identifier 'file_'
file_
^
(lldb) p size
error: <user expression 23>:1:1: reference to overloaded function could not be resolved; did you mean to call it?
size
^~~~
note: possible target for call
I follow pagination example from Doctrine but get fatal error:
PHP Fatal error: Uncaught Doctrine\ORM\Query\QueryException: SELECT * FROM Model\Report r in /usr/share/nginx/html/td/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:43
Stack trace:
#0 /usr/share/nginx/html/td/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(456): Doctrine\ORM\Query\QueryException::dqlError('SELECT * FROM M...')
#1 /usr/share/nginx/html/td/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(2253): Doctrine\ORM\Query\Parser->syntaxError('IdentificationV...', Array)
#2 /usr/share/nginx/html/td/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(1182): Doctrine\ORM\Query\Parser->SelectExpression()
#3 /usr/share/nginx/html/td/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(878): Doctrine\ORM\Query\Parser->SelectClause()
#4 /usr/share/nginx/html/td/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(847): Doctrine\ORM\Query\Parser->SelectStatement()
#5 /usr/share/nginx/html/td/ven in /usr/share/nginx/html/td/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php on line 54
Here is the default example from Doctrine
https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/tutorials/pagination.html
and here is my code:
<?php
use Doctrine\ORM\Tools\Pagination\Paginator;
require "bootstrap.php";
$dql = 'SELECT * FROM reports';
$max = isset($args[1])?$args[1]:5;
$query = $entityManager->createQuery($dql)->setFirstResult(0)->setMaxResults($max);
$paginator = new Paginator($query, $fetchJoinCollection = false);
$c = count($paginator);
foreach($paginator as $report){
echo $report->getName() . "\n";
}
There is no wildcard * in dql select.
Change
$dql = 'SELECT * FROM reports';
to
$dql = 'SELECT r FROM Model\Report r';
References
Wildcard in doctrine dql error
Doctrine select queries
I have the following query,
CREATE OR REPLACE TRIGGER display_salary_changes
BEFORE INSERT ON marks
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
sal_diff number;
BEGIN
sal_diff:=:NEW.sub1-:OLD.sub1;
dbms_output.put_line('Old salary: ' || :OLD.sub1);
dbms_output.put_line('New salary: ' || :NEW.sub1);
dbms_output.put_line('Salary difference: ' || sal_diff);
END;
When I try to run this it throws,
ORA-04098: trigger 'PRAS.B' is invalid and failed re-validation
NAME TYPE SEQUENCE LINE POSITION TEXT ATTRIBUTE MESSAGE_NUMBER
B TRIGGER 1 9 38 PLS-00201: identifier 'OLD.SUB1' must be declared ERROR 201
B TRIGGER 2 9 2 PL/SQL: Statement ignored ERROR 0
B TRIGGER 3 10 41 PLS-00201: identifier 'NEW.SUB1' must be declared ERROR 201
B TRIGGER 4 10 2 PL/SQL: Statement ignored ERROR 0
for some reason i can't tell, there is exception when i try to get a list from CriteriaQuery using subquery. some one please help!!!
here is the code:
public String[] getProductsDistinctBySubQueriesName(String category) {
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<Tuple> criteria = builder.createTupleQuery();
//subquery
Subquery<Integer> subqueries = criteria.subquery(Integer.class);
Root<Productscategory> productCategory = subqueries.from(Productscategory.class);
subqueries.select(productCategory.<Integer>get("productscategoryid"))
.where(builder.equal((productCategory.<String>get("productcatgoryname")), category));
//outerquery
Root<Products> root = criteria.from(Products.class);
criteria.multiselect(root.get(Products_.productname)).distinct(true)
.where(builder.in(root.get("productscategoryid")).value(subqueries));
List<Tuple> tupleResult = em.createQuery(criteria).getResultList(); // the exception is thrown here
String[] arrayProducts = new String[tupleResult.size()];
for (int i = 0; i < tupleResult.size(); i++) {
arrayProducts[i] = (String) tupleResult.get(i).get(0);
}
return arrayProducts;
}
here is the exception
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = 'Pri' at line 1
Error Code: 1064
Error Code: 1064
Call: SELECT DISTINCT t0.productname FROM products t0 WHERE t0.productscategoryid IN (SELECT t1.productscategoryid.t1.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = ?))
bind => [1 parameter bound]
Call: SELECT DISTINCT t0.productname FROM products t0 WHERE t0.productscategoryid IN (SELECT t1.productscategoryid.t1.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = ?))
bind => [1 parameter bound]
Query: TupleQuery(referenceClass=Products sql="SELECT DISTINCT t0.productname FROM products t0 WHERE t0.productscategoryid IN (SELECT t1.productscategoryid.t1.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = ?))")
Query: TupleQuery(referenceClass=Products sql="SELECT DISTINCT t0.productname FROM products t0 WHERE t0.productscategoryid IN (SELECT t1.productscategoryid.t1.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = ?))")
at org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:378)
at org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:378)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:260)
at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:469)
at com.inventory.service.ProductsServices.getProductsDistinctBySubQueriesName(ProductsServices.java:112)
at com.inventory.service.ProductsServices.getAllByName(ProductsServices.java:211)
at com.inventory.server.InventorySocketRequest.getServiceClass(InventorySocketRequest.java:77)
at com.inventory.server.InventorySocketRequest.run(InventorySocketRequest.java:44)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = 'Pri' at line 1
Error Code: 1064
Call: SELECT DISTINCT t0.productname FROM products t0 WHERE t0.productscategoryid IN (SELECT t1.productscategoryid.t1.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = ?))
bind => [1 parameter bound]
Query: TupleQuery(referenceClass=Products sql="SELECT DISTINCT t0.productname FROM products t0 WHERE t0.productscategoryid IN (SELECT t1.productscategoryid.t1.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = ?))")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:682)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1991)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2738)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:2675)
at org.eclipse.persistence.queries.ReportQuery.executeDatabaseQuery(ReportQuery.java:848)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1793)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1775)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1740)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
... 5 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.productscategoryid FROM productscategory t1 WHERE (t1.productcatgoryname = 'Pri' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1007)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:642)
... 24 more
Try to use this query instead of yours, this works perfectly with EclipseLink provider, not sure what your query is not working in eclipselink but works in hibernate, I tested the query below and you will be able to select Products based on a ProductCategoryName.
EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpaQuery");
EntityManager em = emf.createEntityManager();
String category = "cat2";
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<Products> query = builder.createQuery(Products.class);
Root<Products> products = query.from(Products.class);
Subquery<Productscategory> squery = query.subquery(Productscategory.class);
Root<Productscategory> productCategoryRoot = squery.from(Productscategory.class);
Join<Productscategory, Products> join = productCategoryRoot.join("productsCollection");
squery.select(productCategoryRoot)
.where(builder.equal(join, products), builder.equal(productCategoryRoot.get("productcatgoryname"), category));
query.where( builder.exists(squery));
List<Products> productList = em.createQuery(query).getResultList();
for (Products product : productList) {
System.out.println(product);
}
In which category is the name of the category you are trying to search..
This solved the problem =).. If this works, don't forget to accept the answer XD.