Skip to main content
Question

Laravel authentication segmentation fault during odbc connect

  • July 20, 2020
  • 11 replies
  • 22 views

mgvertica
Forum|alt.badge.img+1

I use Laravel 7 and pdo and odbc, my database is Vertica DB 9.2 and it's ODBC works fine with isql. In Laravel when I run raw query there is no problem, but when I try to login the "artisan serve" command returns "segmentation fault (core dumped)" and Laravel exits.

Other information:
Ubuntu 16.04, Laravel 7.8, PHP 7.4.5, php7.4-odbc, PDO, Vertica DB 9.2
https://stackoverflow.com/questions/61590017/laravel-authentication-segmentation-fault-during-odbc-connect

11 replies

Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • July 21, 2020

Hi, I did a brief test with PDO in a PHP script not using Laravel, but could not reproduce the issue. However, I am using ODBC driver 10.0.0. It's possible that there is an issue in 9.2 that has been fixed, so are you able to obtain the latest driver from the Vertica web site and test with that?


Hemanthrahul
Forum|alt.badge.img
  • Participating Frequently
  • July 21, 2020

I will also try to setup the complete similar environment with Vertica 10 driver and see if i can reproduce the issue.


mgvertica
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • July 23, 2020

Today I check Vertica 10.0.0 and Client Driver (ODBC) 10.0 but I had the problem again!
Any idea?


Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • July 23, 2020

We will try to replicate with the exact setup and versions, but was there any other log available, such as a stack trace? Does the artisan binary or package offer debug or trace logging?


Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • July 23, 2020

How did you install php7.4? I created a Ubuntu 16.04 LTS instance on AWS and followed the directions to add a custom repository and was able to replicate the issue.
However, I was able to get it to work by installing the build dependencies (unixODBC, unixODBC-devel, etc.) and build from source as follows:

./configure --with-pdo-odbc=unixODBC,/usr/ --without-sqlite3 --without-pdo-sqlite
make
sudo make install

You'll likely need to remove all of the packaged php7.4 before building from source, and may need to install additional dependencies.


mgvertica
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • September 15, 2020

I remove all php packages and install them again, but I had the problem again!


Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • September 15, 2020

How did you install them: package manager like yum, or from web site, or from compiled source as shown above? You should also check the PATH and other environment variables like LD_LIBRARY_PATH to verify that the expected web server and PHP installation were selected, and that no other PHP binaries or libraries are found in any path.


mgvertica
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • September 16, 2020

I use apt-get and install packages in ubuntu terminal


mgvertica
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • September 19, 2020

I found the problem in "Laravel forum", but problem is still alive!
It happened because using ORM. For example when you use raw queries such as:
DB::select("SELECT * from users where username = 'user_name' limit 1;");
there is no problem, but when I use eloquent such as:
DB::table('users')->where('username', 'user_name')->select('email')->get();
error occurs.
Thanks Vertica!


mgvertica
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • September 20, 2020

chloemartin
  • New Participant
  • March 29, 2022

Is it true or not that you are utilizing an odbc driver/bundle for Laravel? Without it, Laravel will attempt to perform normal inquiries and utilize an ordinary association with do that. On the off chance that your data set isn't viable with that you could get these abnormal mistakes. You need to utilize an expressive viable driver to make this work. you can also read my blog also about laravel 9.2
You can likewise check the log documents away/logs. Perhaps you can discover some heading in there.