Code Monkey home page Code Monkey logo

Comments (6)

 avatar commented on May 25, 2024 2

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.

ppshobi avatar ppshobi commented on May 25, 2024

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.

 avatar commented on May 25, 2024

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.

ppshobi avatar ppshobi commented on May 25, 2024

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.

 avatar commented on May 25, 2024

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.

ppshobi avatar ppshobi commented on May 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.