Comments (6)
Ok, after a couple hours looking for this problem, I found there was a bug in the way the Laravel function encodes the string, so in the end resulted in a completely different one (I guess this is due to special characters inside the password). Already solved that issue and works like a charm, thanks man.
from psonic.
hey... Thanks for posting the bug. will you please post your code? So that I can test in my local, and pinpoint the issue. But probably it's because of the second argument of str_split
, that calculation is returning probably a negative number because the buffer size might be too low. Still no clue about why setting the old password does fix the issue. Let me know your ideas
from psonic.
Hey, thank you for answering so fast.
Didn't have the time to look through all the code, but I ll do as soon as I can.
I am using the php client on Laravel, setting Sonic as an external service and the connection arguments of the channel as environmental variables (host
, port
and password
). This is a simplification of my code (actually pretty similar to the examples).
class SonicHandler {
private $host;
private $port;
private $password;
public function __construct(){
$this->host = config('services.sonic.host'); //defined in env file
$this->port = config('services.sonic.port'); //defined in env file
$this->password = config('services.sonic.password'); //defined in env file
}
public function ingestSlug(){
$ingest = new Psonic\Ingest(new Psonic\Client($this->host, $this->port));
$control = new Psonic\Control(new Psonic\Client($this->host, $this->port));
$ingest->connect($this->password); //<- IT FAILS HERE
$control->connect($this->password);
$stat = $ingest->push('collection', 'bucket', 'key', 'search_text')->getStatus();
I thought at first it was not passing correctly the environmental variables but as host and port are correct, don't see the problem there.
Now, for the password. This is autogenerated key that contains special characters like for example "%gVZ8*5aONL6O#x7TEydEHX35Oo2@@"
. Don't think the password itself is the problem so it is passed as a literal.
To be honest, didn't try yet with overwrite the default password with the default password. I mean, passing 'SecretPassword' as an argument.
from psonic.
hmm... pretty strange issue. because I tried with really long passwords to check if it is related to the buffer size, but all of my tests are passing. So I have one more question, how are you setting the password of the sonic engine? via the .cfg
file? then can you make sure the password of the sonic engine and the password you provide in the client are same?
from psonic.
Yes, I am using the cgf file. I am quite sure is the same password though. Not much different from the original one quoted in the default .cfg. Is working the same configuration for you then? I will take a look again tomorrow to see if I can find the problem.
from psonic.
the password you generate (ie:%gVZ8*5aONL6O#x7TEydEHX35Oo2@@
) should be equal to the one in config.cfg
's auth_password
configuration. If you still face issue, lets do a screenshare over zoom or skype
from psonic.
Related Issues (13)
- Migrate to PHP v7.4 HOT 1
- Why can't search some records ? HOT 6
- PHP 8 support HOT 2
- Server response is not complete HOT 3
- WordPress connector plugin needed. ..
- let password read from environment
- set read buffer size from environment/configuration
- Support PHP 8.1
- Support PHP 8.2
- PHP Fatal error: Uncaught ValueError: str_split(): Argument #2 ($length) must be greater than 0 HOT 2
- Without $password for Psonic/Client HOT 1
- Password set on Ingest/Control connect() HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psonic.