what does this fluid error means? No unique path segment could be found after 100 iterations - fluid

I get this error on an order review page:
Exception while rendering
checkout<TYPO3.Neos:Page>/
body<TYPO3.TypoScript:Template>/
content/
main<TYPO3.Neos:PrimaryContent>/
default<TYPO3.TypoScript:Matcher>/
element<TYPO3.Neos:ContentCollection>/
itemRenderer<TYPO3.Neos:ContentCase>/
default<TYPO3.TypoScript:Matcher>/
element<SeeThroughWeb.Shop:ShopOrderReview>:
No unique path segment could be found after 100 iterations. (201409261654538b6e30)
Any idea why or what it means? BTW, I use the same template on another site and get no such error there. I am using Flow 2.1 and Neos .99 .
Thanks
The method declaration is:
/**
* A new form to fill shipping address
*
* #param \SeeThroughWeb\Shop\Domain\Model\Address $address List of address
* #param integer $changeAddress
* #return void
*/
public function shippingAddressAction(\SeeThroughWeb\Shop\Domain\Model\Address $address = NULL, $changeAddress = 0) {
and here is a fuller listing of the template section referenced in my comment below:
<f:for each="{addresses}" as="address">
<li>
<f:link.action action="shippingAddress" arguments="{address: address}">{address.title}</f:link.action>
</li>
</f:for>
A similar error ont he same page, seems to be related tot he address variable somehow:
14-11-05 17:18:27 CRITICAL Fluid Uncaught exception #1316441798: No unique path segment could be found after 100 iterations. - See also: 201411051718246a61dd.txt
previousException => Uncaught exception #1316441798 in line 198 of /home/thebigcarrot/domains/shop.thebigcarrot.ca/public_html/releases/20131219160416/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/TYPO3_Flow_Mvc_Routing_IdentityRoutePart.php: No unique path segment could be found after 100 iterations.
and the exception log looks like this:
Uncaught exception #1316441798: No unique path segment could be found after 100 iterations.
80 TYPO3\Fluid\ViewHelpers\Link\ActionViewHelper_Original::render("editOrderAddressForAdmin", array|2|, "OrderManagement", NULL, NULL, "", "", array|0|, FALSE, array|0|, FALSE)
79 call_user_func_array(array|2|, array|11|)
78 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::callRenderMethod()
77 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::initializeArgumentsAndRender()
76 TYPO3\Fluid\Core\Parser\SyntaxTree\ViewHelperNode_Original::evaluate(TYPO3\Fluid\Core\Rendering\RenderingContext)
75 TYPO3\Fluid\Core\Parser\SyntaxTree\AbstractNode::evaluateChildNodes(TYPO3\Fluid\Core\Rendering\RenderingContext)
74 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::renderChildren()
73 TYPO3\Fluid\ViewHelpers\SectionViewHelper_Original::render()
72 call_user_func_array(array|2|, array|0|)
71 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::callRenderMethod()
70 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::initializeArgumentsAndRender()
69 TYPO3\Fluid\Core\Parser\SyntaxTree\ViewHelperNode_Original::evaluate(TYPO3\Fluid\Core\Rendering\RenderingContext)
The declaration of editOrderAddressForAdmin looks like this:
/**
* Edit order address for admin
*
* #param \SeeThroughWeb\Shop\Domain\Model\Address $address
* #param integer $shipping
* #Flow\IgnoreValidation("$address")
* #return void
*/
public function editOrderAddressForAdminAction(\SeeThroughWeb\Shop\Domain\Model\Address $address , $shipping = 0) {
$this->view->assign('address', $address);
$this->view->assign('shipping', $shipping);
$countryAndStates = $this->taxZoneService->getCountryAndStates();
$this->view->assign('countries', $countryAndStates['country']);
$this->view->assign('states', $countryAndStates['state']);
}
In the template I can avoid the exception by commenting out the following line:
<f:link.action action="editOrderAddressForAdmin" controller="OrderManagement" arguments="{address: order.shippingAddress, shipping: 1}" >
<div class="editOrderDetails">(edit)</div>
</f:link.action>
So again its a link that involves an address object.

Problem lies in address argument..
I guess you may have wrong type defined for address argument for shippingAddressAction().. sth like #param \My\Package\..\wrongType $address.
Second thing might be related to Routes.yaml - for example error in routeParts.. not unique property used in uriPattern or again wrong objectType there..
You can also add #Flow\IgnoreValidation("$address") in shippingAddressAction() - and check what happens, look at the bottom of http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartII/Validation.html

Related

Error when sending message to Bloomberg via QuickFixJ

I'm trying to sending packet type X to Bloomberg via QuickFixJ. I'm able to connect successfully but when I send the packet, I receive an error message :
8=FIXT.1.1^A9=160^A35=X^A34=4^A49=ARHGBETA^A52=20210915-13:16:04.156^A56=BBGBETA^A1022=****^A22=1^A48=BQ4434677^A268=2^A279=0^A269=0^A270=99.00357818603516^A279=0^A269=1^A270=99.01358032226562^A10=060^A
8=FIXT.1.1^A9=253^A35=j^A49=BBGBETA^A56=ARHGBETA^A34=4^A52=20210915-13:16:04.380^A45=4^A372=X^A380=0^A58=Validation failed for incoming X packet:
In mDIncGrp: In groupMDEntries[0]: NULL component instrument_MarketData
In groupMDEntries[1]: NULL component instrument_MarketData
And yet, I don't see how to define the component instrument_MarketData. I'm using the following code to generate the groups:
/**
* Méthode de création d'un nouveau prix pour le publier sur Bloomberg
* #param marketPrice
* */
public MarketDataIncrementalRefresh createMarketDataIncrementalRefresh(MarketPrice marketPrice) {
quickfix.fix50sp2.MarketDataIncrementalRefresh message = new MarketDataIncrementalRefresh();
quickfix.fix50sp2.MarketDataIncrementalRefresh.NoMDEntries group = new MarketDataIncrementalRefresh.NoMDEntries();
message.getHeader().setString(1022, "****");
quickfix.fix50sp2.component.MDIncGrp mdIncGrp = new MDIncGrp();
mdIncGrp.setString(48, marketPrice.getCUSIP());
mdIncGrp.setString(22, "1");
Instrument instrument =new Instrument();
/**
* Ajout prix Bid au message
* */
instrument.setString(279, "0");
instrument.setString(269, "0");
instrument.setString(270, marketPrice.getBid_kech().toString());
group.set(instrument);
mdIncGrp.addGroup(group);
/**
* Ajout prix Ask au message
* */
instrument.setString(279, "0");
instrument.setString(269, "1");
instrument.setString(270, marketPrice.getAsk_kech().toString());
group.set(instrument);
mdIncGrp.addGroup(group);
message.set(mdIncGrp);
return message;
}
What am I doing wrong? Should I define a custom dictionary to be able to send the message or can I do it with the default dictionary?
Many thanks in advance !
You do not need a custom dictionary to send custom messages. Dictionary validation is only done for received messages, so you might need to alter your dictionary to successfully receive the responses sent by your counterparty.
As to your problem: the error sounds as if something is missing in your group regarding the instrument. Looking at your code I think you mix up the group stuff a bit. I posted this link for an earlier question of you: https://www.quickfixj.org/usermanual/2.3.0/usage/repeating_groups.html
I think the important part is that you should add the group to the message like so:
quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries group =
new quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries();
group.set(new MDEntryType('0'));
group.set(new MDEntryPx(12.32));
group.set(new MDEntrySize(100));
group.set(new OrderID("ORDERID"));
message.addGroup(group); // important part
In your code you are adding a group to a group (mdIncGrp.addGroup(group)) and do a message.set(mdIncGrp) where you really should use addGroup(). Because of this the 48/SecurityID field does not end up in the MDIncGrp but the root message.
8=FIXT.1.1^....removed...^A22=1^A48=BQ4434677^A268=2^A279=0^A269=0^A270=99.00357818603516^A279=0^A269=1^A270=99.01358032226562^A10=060^A
^^^ 48 is here where it should really
be in each of these groups starting with delimiter tag 279

Property Photo Files with PHRETS v2

My php code, below, attemps to download all the photos for a property listing. It successfully queries the RETS server, and creates a file for each photo, but the file does not seem to be a functional image. (MATRIX requires files to be downloaded, instead of URLs.)
The list of photos below suggests that it successfully queries one listing id (47030752) for all photos that exist, (20 photos in this case). In a web browser, the files appear only as a small white square on a black background: e.g. (https://photos.atlantarealestate-homes.com/photos/PHOTO-47030752-9.jpg). The file size (4) also seems to be very low, as compared to that of a real photo.
du -s PHOTO*
4 PHOTO-47030752-10.jpg
4 PHOTO-47030752-11.jpg
4 PHOTO-47030752-12.jpg
4 PHOTO-47030752-13.jpg
4 PHOTO-47030752-14.jpg
4 PHOTO-47030752-15.jpg
4 PHOTO-47030752-16.jpg
4 PHOTO-47030752-17.jpg
4 PHOTO-47030752-18.jpg
4 PHOTO-47030752-19.jpg
4 PHOTO-47030752-1.jpg
4 PHOTO-47030752-20.jpg
4 PHOTO-47030752-2.jpg
4 PHOTO-47030752-3.jpg
4 PHOTO-47030752-4.jpg
4 PHOTO-47030752-5.jpg
4 PHOTO-47030752-6.jpg
4 PHOTO-47030752-7.jpg
4 PHOTO-47030752-8.jpg
4 PHOTO-47030752-9.jpg
script I'm using:
#!/usr/bin/php
<?php
date_default_timezone_set('this/area');
require_once("composer/vendor/autoload.php");
$config = new \PHRETS\Configuration;
$config->setLoginUrl('https://myurl/login.ashx')
->setUsername('myser')
->setPassword('mypass')
->setRetsVersion('1.7.2');
$rets = new \PHRETS\Session($config);
$connect = $rets->Login();
$system = $rets->GetSystemMetadata();
$resources = $system->getResources();
$classes = $resources->first()->getClasses();
$classes = $rets->GetClassesMetadata('Property');
$host="localhost";
$user="db_user";
$password="db_pass";
$dbname="db_name";
$tablename="db_table";
$link=mysqli_connect ($host, $user, $password, $dbname);
$query="select mlsno, matrix_unique_id, photomodificationtimestamp from fmls_homes left join fmls_images on (matrix_unique_id=mls_no and photonum='1') where photomodificationtimestamp <> last_update or last_update is null limit 1";
print ("$query\n");
$result= mysqli_query ($link, $query);
$num_rows = mysqli_num_rows($result);
print "Fetching Images for $num_rows Homes\n";
while ($Row= mysqli_fetch_array ($result)) {
$matrix_unique_id="$Row[matrix_unique_id]";
$objects = $rets->GetObject('Property', 'LargePhoto', $matrix_unique_id);
foreach ($objects as $object) {
// does this represent some kind of error
$object->isError();
$object->getError(); // returns a \PHRETS\Models\RETSError
// get the record ID associated with this object
$object->getContentId();
// get the sequence number of this object relative to the others with the same ContentId
$object->getObjectId();
// get the object's Content-Type value
$object->getContentType();
// get the description of the object
$object->getContentDescription();
// get the sub-description of the object
$object->getContentSubDescription();
// get the object's binary data
$object->getContent();
// get the size of the object's data
$object->getSize();
// does this object represent the primary object in the set
$object->isPreferred();
// when requesting URLs, access the URL given back
$object->getLocation();
// use the given URL and make it look like the RETS server gave the object directly
$object->setContent(file_get_contents($object->getLocation()));
$listing = $object->getContentId();
$number = $object->getObjectId();
$url = $object->getLocation();
//$photo = $object->getContent();
$size = $object->getSize();
$desc = $object->getContentDescription();
if ($number >= '1') {
file_put_contents("/bigdirs/fmls_pics/PHOTO-{$listing}-{$number}.jpg", "$object->getContent();");
print "$listing - $number - $size $desc\n";
} //end if
} //end foreach
} //end while
mysqli_close ($link);
fclose($f);
php?>
Are there any suggested changes to capture photos into the created files? This command creates the photo files:
file_put_contents("/bigdirs/fmls_pics/PHOTO-{$listing}-{$number}.jpg", "$object->getContent();");
There may be some parts of this script that wouldn't work in live production, but are sufficient for testing. This script seems to successfully query for the information needed from the RETS server. The problem is just simply that the actual files created do not seem to be functional photos.
Thanks in Advance! :)
Your code sample is a mix of the official documentation and a usable implementation. The problem is with this line:
$object->setContent(file_get_contents($object->getLocation()));
You should completely take that out. That's actually overriding the image you downloaded with nothing before you get a chance to save the contents to a file. With that removed, it should work as expected.

call the first feature from the second feature file, failed without specified clue

Run the first.feature file successfully,however, call it from the second.feature failed without any clue to analysis. Do you have any idea help me find the root cause?
The source of my first.feature:
Feature: 采样管理-样本登记
Background: 读取随机生成的条形码、手机号、采样类型等作为入参
* url baseURL
* def randomData = Java.type('utils.RandomData')
* def barcode = randomData.getRandom(11)
* def randomPhone = randomData.getTelephone()
* def sampletype = randomData.getNum(0,1)
Scenario: 输入合法参数进行正常样本登记,确认能够登记成功
Given path 'iEhr/PersonSample'
# * header Content-type = 'application/x-www-form-urlencoded; charset=UTF-8'
* cookies { JSESSIONID: '#(jsessionID)',SESSION: '#(sessionID)', ACMETMP: '#(acmetmpID)'}
* def autoMotherName = "autoMname"+ barcode
# * def confData = {mothername: "#(autoMotherName)", barcode: "#(barcode)", mobile: '#(randomPhone)', sampletype:"#(sampletype)" }
# 设置sampletype为1,已被采样
* def confData = {mothername: "#(autoMotherName)", barcode: "#(barcode)", mobile: '#(randomPhone)', sampletype:"1" }
# 打印入参变量输出
* print confData
# 用例与数据分离
* def paramObj = read('classpath:mainFlow/sampleSaveReqTest.json')
* print paramObj
* form field param = paramObj
When method post
Then status 200
* json result = response[0].result
* def personId = result[0].personid
* def sampleid = result[0].sampleid
* print personId
* print sampleid
The source of my second.feature:
Feature: 提交递送样本
Background:
* def sampleResult = call read('classpath:mainFlow/first.feature')
* print sampleResult
I run the first.feature singly, it works. However, karate reports the error below after running the second.feature. Any idea how can I debug to find the root cause? I have no idea what's wrong with the second read. Many thanks!
* def sampleResult = call read('classpath:mainFlow/first.feature')
-unknown-:14 - javascript evaluation failed: read('classpath:mainFlow/first.feature'), null
Look for some issue with karate-config.js. As Babu said in the comments, it is very hard to make out what the problem is, I suggest you follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
Also try if the latest preview version 0.9.3.RC2 is better at showing what the error is.
If you can replicate the problem as a small example, it will help us - because we really need to do better at showing more useful error logs, instead of just null.

Cannot use threads to insert data to PostgreSQL with DBIish. What's going wrong?

Edit: This was solved by moritz. I've added a note to the code on the line that's wrong.
My application is a web server talking to a game client. The server is multithreaded, which Postgres allows. When loading client data into the database, I noticed parallel requests fail with several different errors, none of which make sense to me.
This short-ish test case dumps a nested hash into the database. When run without start, it works perfectly. When run with threads, it almost always gives one or more of the following errors:
DBDish::Pg: Error: (7) in method prepare at
D:\rakudo\share\perl6\site\sources\BAD7C1548F63C7AA7BC86BEDDA0F7BD185E141AD
(DBDish::Pg::Connection) line 48 in block at testcase.p6 line 62
in sub add-enum-mappings at testcase.p6 line 59 in block at
testcase.p6 line 91
DBDish::Pg: Error: ERROR: prepared statement
"pg_3448_16" already exists (7) in method prepare at
D:\rakudo\share\perl6\site\sources\BAD7C1548F63C7AA7BC86BEDDA0F7BD185E141AD
(DBDish::Pg::Connection) line 46 in block at testcase.p6 line 62
in sub add-enum-mappings at testcase.p6 line 59 in block at
testcase.p6 line 91
DBDish::Pg: Error: Wrong number of arguments to
method execute: got 1, expected 0 (-1) in method enter-execute at
D:\rakudo\share\perl6\site\sources\65FFB78EFA3030486D1C4D339882A410E3C94AD2
(DBDish::StatementHandle) line 40 in method execute at
D:\rakudo\share\perl6\site\sources\B3190B6E6B1AA764F7521B490408245094C6AA87
(DBDish::Pg::StatementHandle) line 52 in sub add-enum-mappings at
testcase.p6 line 54 in block at testcase.p6 line 90
message type 0x31 arrived from server while idle
message type 0x5a arrived from server while idle
message type 0x74 arrived from server while idle
message type 0x6e arrived from server while idle
message type 0x5a arrived from server while idle
Here's the code. (If you choose to run it, remember to set the right password. It creates/manipulates a table called "enummappings", but does nothing else.) The meat is in add-enum-mappings(). Everything else is just setup. Oh, and dbh() creates a separate DB connection for each thread. This is necessary, according to the PostgreSQL docs.
#!/usr/bin/env perl6
use DBIish;
use Log::Async;
my Lock $db-lock;
my Lock $deletion-lock;
my Lock $insertion-lock;
INIT {
logger.send-to($*ERR);
$db-lock .= new;
$deletion-lock .= new;
$insertion-lock .= new;
}
# Get a per-thread database connection.
sub dbh() {
state %connections;
my $dbh := %connections<$*THREAD.id>; # THIS IS WRONG. Should be %connections{$*THREAD.id}.
$db-lock.protect: {
if !$dbh.defined {
$dbh = DBIish.connect('Pg', :host<127.0.0.1>, :port(5432), :database<postgres>,
:user<postgres>, :password<PASSWORD>);
}
};
return $dbh;
}
sub create-table() {
my $name = 'enummappings';
my $column-spec =
'enumname TEXT NOT NULL, name TEXT NOT NULL, value INTEGER NOT NULL, UNIQUE(enumname, name)';
my $version = 1;
my $sth = dbh.prepare("CREATE TABLE IF NOT EXISTS $name ($column-spec);");
$sth.execute;
# And add the version number to a version table:
dbh.execute:
"CREATE TABLE IF NOT EXISTS tableversions (name TEXT NOT NULL UNIQUE, version INTEGER NOT NULL);";
$sth = dbh.prepare:
'INSERT INTO tableversions (name, version) VALUES (?, ?)
ON CONFLICT (name)
DO
UPDATE SET version = ?;';
$sth.execute($name, $version, $version);
}
sub add-enum-mappings($enumname, #names, #values --> Hash) {
$deletion-lock.protect: {
my $sth = dbh.prepare('DELETE FROM enummappings WHERE enumname = ?;');
$sth.execute($enumname);
};
my #rows = (^#names).map: -> $i {$enumname, #names[$i], #values[$i]};
info "Inserting #rows.elems() rows...";
$insertion-lock.protect: {
my $sth = dbh.prepare('INSERT INTO enummappings (enumname,name,value) VALUES '~
('(?,?,?)' xx #rows.elems).join(',') ~ ';');
$sth.execute(#rows>>.list.flat);
};
return %(status => 'okay');
}
# Create a bunch of long enums with random names, keys, and values.
sub create-enums(--> Hash[Hash]) {
my #letters = ('a'..'z', 'A'..'Z').flat;
my Hash %enums = ();
for ^36 {
my $key = #letters.pick(10).join;
for ^45 {
my $sub-key = #letters.pick(24).join;
%enums{$key}{$sub-key} = (0..10).pick;
}
}
return %enums;
}
sub MAIN() {
create-table;
await do for create-enums.kv -> $enum-name, %enum {
start {
add-enum-mappings($enum-name, %enum.keys, %enum.values);
CATCH { default { note "Got error adding enum: " ~ .gist; } }
};
}
}
I'm on Windows 10, with a 8-core computer. I know I could insert the data single-threadedly, but what if the game gets a hundred connections at once? I need to fix this for good.
I suspect your problem is here:
my $dbh := %connections<$*THREAD.id>;
The %hash<...> syntax is only for literals. You really need to write %connections{$*THREAD.id}.
With your error in place, you have just one DB connection that's shared between all threads, and I guess that's what DBIish (or the underlying postgresql C client library) is unhappy about.

Prestashop 1.6.1.4 - Root category must be an integer value

I'm trying a fresh installation of prestashop 1.6.1.4, first I got SQL error on query All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead​ and used the following solution https://www.prestashop.com/forums/topic/480947-error-presta-on-server-2012-r2-sql-error-on-query-all-parts-of-a-primary-key-must-be-not-null/
But now, after install, when I go to admin > catalog I get:
[PrestaShopException]
Root category must be an integer value
at line 212 in file classes/helper/HelperTreeCategories.php
207. }
208.
209. public function setRootCategory($value)
210. {
211. if (!Validate::isInt($value)) {
212. throw new PrestaShopException('Root category must be an integer value');
213. }
214.
215. $this->_root_category = $value;
216. return $this;
217. }
HelperTreeCategoriesCore->setRootCategory - [line 2504 - controllers/admin/AdminProductsController.php] - [1 Arguments]
AdminProductsControllerCore->initContent - [line 189 - classes/controller/Controller.php]
ControllerCore->run - [line 367 - classes/Dispatcher.php]
DispatcherCore->dispatch - [line 58 - admin1/index.php]
$value is empty
Note: I'm trying to install this specific version because I'm debugging:
Cannot save or edit product data in Prestashop 1.6.1.4
The error that you have mentioned appears if the home category is deleted anyhow. Try adding a home category, make it the root category.
For more details you can visit:
http://forge.prestashop.com/browse/NM-606