Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Links SQL BUGS and problems : HELP!!!!!!!!!!

Quote Reply
Links SQL BUGS and problems : HELP!!!!!!!!!!
Hello Alex,

Using 1.02 version of Links SQL. Tried to installa all again and had a nightmare. It does not seems like that I may be able to make it in the year of 1999. What a horror to use it. One starts with great expectations and ends in disappointments.

I do not understand why the following message appears...........
------------------------------------------------
1-Building Pages ...

Backing up database ...
Backing up links data ...
Content-type: text/html

Software error:

Can't use an undefined value as an ARRAY reference at Links/DBSQL.pm line 872.
----------------------------------------
2-View / Add or Search in Links table of Admin.

Content-type: text/html

Software error:

Can't use an undefined value as a HASH reference at Links/DBSQL.pm line 472.
-------------------------------------------
3 - In Admin if I click Re-index then

Software error:

Fatal Error: Unable to execute query:
SELECT COUNT(*) FROM
. Reason: You have an error in your SQL syntax near '' at line 3 at admin/nph-index.cgi line 47
----------------------------------
4 -
Verifying Links
Quick Check
Detailed

Verifying started on Sun Aug 22 15:34:05 1999
Using IO::Socket.

No further activity reported. It stops.
-------------------------------------
5 - In Admin I click on one of the following :
Categories
View
Add
Delete
Modify

Then I get

Links SQL Administration: Search the Database
Search the Database

But .............. no information. So I do the search. I try to search the term rajani from the database then I get ........

Software error:

Can't use an undefined value as a HASH reference at Links/DBSQL.pm line 472.

If I click on List all then

Search Failed

There were problems with the search. Reason: No search terms were specified.

If I click Modify category, then there is no list appearing of the categories that are already in the database.
-----------------------------------
6 - Add a New Links from the admin.

It does not show and form. Even then, if I click on add a new link to see what happens then,

Software error:

Can't use an undefined value as a HASH reference at Links/DBSQL.pm line 1157.

Reset form does not pick up the click, i.e. does not work.
----------------------------------------
7 - In DBSQL.pm line 173 I need to specify the driver there and only then it works, otherwise it gives a software error, connect error. So the array made few lines above it does not make sense.


By the way has someone got this version 1.02 working?











[This message has been edited by rajani (edited August 22, 1999).]
Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
I'm using 1.02

Are you sure you reinstalled it properly?

Because of the use of the SQL database you can't just install.

You have also been playing with your system a lot, so unless you did a true, base-level re-install, you probably have some mods that were made that are interfering with the new installation.

If you installed 1.02 over your running version, then make sure you carried your mods from 1.0/.01 over to 1.02.
Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
I think the line 173 goes back to the inital set up of the LinkSQL program.

If you are not going through all the steps. then when you reinstall links (I just did it today, and I reimport my links 2.0 database 2-3 times a week) you need to leave all your *.def files alone. They are where the connect information has to reside.

Quote:
carp "DBSQL: Connected: DBI:$driver:$name:$host, '$user', 'password', $raise, $print\n" if ($DEBUG);
$DBH = DBI->connect ("DBI:$driver:$name:$host", $user, $pass, { RaiseError => $raise, PrintError => $print } ) or return $self->error ('CANTCONNECT', $DBI::errstr);

I've actually edited this file, so I'm not sure that is line 173, but I believe it is.

Make sure your *.def files all have the proper header information.

If you are reinstalling LinkSQL, you _MUST_ start from scratch, or manually edit all the *.def files.

I can empty the database using phpMyAdmin or whatever that program is, copy my links.db, category.db files over from links 2.0, run 'perl Import.pl' and 'build all' and I'm up and running.

If you don't have the *.def files, it's SQL.pl that creates the database tables _and_ builds the correct *.def files.


Quote:
$db_name = 'links';
$db_host = 'localhost';
$db_driver = 'mysql';
$db_user = 'your_userid';
$db_pass = 'your_password';
$db_key = 'LinkID';
$db_table = 'Build_Update';

these variables _must_ be set in each *.def file.

sure, it would be great to be able to set them once, and have the password hidden, etc, but this is the easiest way to do it. Once set up, these files rarely have to be changed. The new edit features make it even less likely you'll need to edit these files unless you are installing or creating mods that need specific alterations.

If Alex adds the few missing functions he said hes' working on, full edit of the tables/database should be possible.

I guess one thing that would be nice, is a "re install" option that would just let you change your password/ID in the *.def files, and bark if one is missing.



Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Hello Mr. Pataki!

Its actually nice how you are helping people everywhere, especially in the modification forum. I read it sometimes and you do really good.

IN my case, here, there is something in the design somewhere, now that I am sure that needs modification from Alex.

Earlier I had DBSQL.pm error at the line 171 and now 173. This is certainly not due to anything else but the programming codes in those scripts that does not work in the best way how it has been thought it to work.

For e.g. DBSQL.pm gives error in the Line 173. This is so upseting as one begines to say, as Alex did, install the tables + database again. This is a lot of hard work. But problem lies somewhere. In this line if I write actually the name + driver + password then the script works perfect. This also means that the database and the uploading and everything has been done correct. It is just the programming that is dissatisfying. More horror I have is when I actually start the project what will happen. I cannot sit down to solve this horrors. This is a nightmare.

It ofcourse can be my mistake all the time but I find it hard to beleive if in the line 173 if DBSQL.pm if it is the way it is then it does not work and if I write user name there it works!!!

Perl paths are correct. I used perl & perl 5 at the end. Last time /usr/local/bin/perl5
address was the problem. 5 was missing. Now I wrote the ISP and they say this cannot be true. This time I have tried both perl + perl5 in the path.

I think there are some routines of connect database that may be giving problems. It is the kind of programming, I mean, probably due to mod_perl capabilities one needs to use certain routines that may not work on all systems.

Well, thats what I think, but I may be wrong.
Quote:
Because of the use of the SQL database you can't just install.
Alex, I would like to debate with you about this topic. Its actually very nice to write such things here on the board instead of emailing to you.
Is this true? Everytime do I have to re-install?
With the help of SQL monitor I can connect the SQL database. With php3 scripts I can connect the database. The database exists and works. Why cannot the Links SQL connect the database, if I can? The defs are the same!!! The scripts are uploaded in ACSII mod, permissions are correct. Admin.cgi works but does not take any command of connection to the database. Do I still have to re-install the database? I or we do not know.

------------------
rajani











Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Let's try and tackle these one at a time:

Quote:
Software error:

Can't use an undefined value as an ARRAY reference at Links/DBSQL.pm line 872.

This refers to '$sth->{'NAME'}'. I can only think you have an old version of DBD::mysql which doesn't create this property. Can you check what version you have? The following should tell you:

perl -MDBD::mysql -e "print $DBD::mysql::VERSION"

As for the other errors, they seem to indicate a bad or corrupted .def file. It doesn't seem to be loading it properly. Can you post what one of them looks like (say Links.def), just comment out your password and username info.

Cheers,

Alex
Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Hello Alex!

I am sure to be a GURU soon under your guidance. Following is what I have done according to your commands, Sir.

% whereis perl
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz

% whereis perl5
perl5: /usr/local/bin/perl5

So, therefore to prove............

% perl -MDBD::mysql -r "print $DBD::mysql::VERSION"
Unknown variable modifier.
% perl5 -MDBD::mysql -e "print $DBD::mysql::VERSION"
Unknown variable modifier.

This is the result!!! Am I doing or typing anything wrong?

Is the dammn DBD module an older version in the server?

I have blasted on my ISP system administrator and he has seen the messages on the UBB from me!!!

As for the defs, they are all sent to the web again and again. They could be corrupted in my harddisk, so then they could be bombing errors one after the other, however if this is not the case then they are all fresh to eat.


-----------------------------
# Auto Generated Config File.
# Created on: Thu Jun 24 13:26:15 1999
#

package DBSQL::Links;

$db_name = 'romance';
$db_host = 'name (and not local host)';
$db_driver = 'mysql';
$db_user = 'darling';
$db_pass = 'sweetheart';
$db_key = 'ID';
$db_table = 'Links';

%db_def = (
ID => ['1', 'INT', '10', '20', '1', '0', '^\d*\.?\d*$'],
Title => ['2', 'CHAR', '40', '100', '1', '', ''],
URL => ['3', 'CHAR', '40', '150', '1', '', ''],
Add_Date => ['4', 'DATE', '20', '20', '1', 'NOW', '^\d{4}\-\d{2}\-\d{2}$'],
Mod_Date => ['5', 'DATE', '20', '20', '1', 'NOW', '^\d{4}\-\d{2}\-\d{2}$'],
CategoryID => ['6', 'INT', '10', '20', '1', '0', '^\d*\.?\d*$'],
Description => ['7', 'CHAR', '40x3', '5000', '0', '', ''],
Contact_Name => ['8', 'CHAR', '40', '50', '0', '', ''],
Contact_Email => ['9', 'CHAR', '40', '50', '0', '', ''],
Hits => ['10', 'SMALLINT', '10', '20', '1', '0', '^\d*\.?\d*$'],
isNew => ['11', 'CHAR', '0', '3', '1', 'No', 'Yes|No'],
isPopular => ['12', 'CHAR', '0', '3', '1', 'No', 'Yes|No'],
Rating => ['13', 'DECIMAL', '10', '20', '1', '0.00', '^\d*\.?\d*$'],
Votes => ['14', 'SMALLINT', '10', '20', '1', '0', '^\d*\.?\d*$'],
ReceiveMail => ['15', 'CHAR', '0', '3', '1', 'Yes', 'Yes|No']
);

%db_select_fields = (
ReceiveMail => 'Yes,No',
isNew => 'Yes,No',
isPopular => 'Yes,No'
);
%db_checkbox_fields = (

);
%db_radio_fields = (

);

1;

The only thing I can think of my problems is that perl does not like my poems anymore Smile!!

[This message has been edited by rajani (edited August 23, 1999).]
Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Hello Dear Friends!

Thanks for your support.

I made an export-defs.pl, it and everything was fine. Noticable here was a description column hanging in air before the ID in Links.

Surprisingly comparing to the ones one my harddisk to the ones perl hatched the new cute ones Wink, there seemed no difference.

The best way to prevent such situations is that always if there is an upgrade.pl which goes through some intellegent things, which one can think a lot here, that would be nice.



------------------
rajani











Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Hello Alex!

I am sure someone will ask how did I export the defs.

I suggest that you insert a link in the editor.cgi which gives the possibility to export the defs.

Thanks

------------------
rajani











Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Hello Alex!

This is the problem.

In the SQL.pl (your name) the definitions are correct. I have dropped all the tables. Now what has come out is this. This description field is hanging there like a ghost before the ID field.

$links = qq~
CREATE TABLE Links (
ID INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,

The result in the database is ..........

%db_def = (
Description => ['', '', '', '', '', '', '', '1'],
ID => ['1', 'INT', '10', '20', '1', '0', '^\d*\.?\d*$'],

This is not in the thing that I have done. The phpMyAdmin shows + mysql monitor shows that there are absolutely no tables. After running the SQL.pl this ghost field appears in the table.

Also I am not using the field name Description but S_Description & L_Description

Both this fields have comeout correct but the field that you set Description always comes or is generated in the database. This means that either DBSQL.pm or DB_Utils.pm is producing it.

Any solution? More over I cannot delete with the help of editor.cgi. It says that

Database Error: Unable to execute query: ALTER TABLE Links DROP Description . Reason: Can't DROP
'Description'. Check that column/key exists

------------------
rajani











Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Strange, try this instead to check your mysql module version:

perl (or perl5 in your case)
use DBD::mysql;
print $DBD::mysql::VERSION;
<ctrl>-D

and it should tell you. Not sure why the -e syntax has problem.

As for the def file, there is definately something wrong. The package name is missing. It should look like:

package Links: BSQL::Links;

for Links.def. To recreate all the def files you can do:

perl SQL.pl

and it will recreate them. It won't erase your data unless you put:

perl SQL.pl -d

and then it will drop and recreate the mysql tables as well (losing all your data). If you don't need to preserve any data, try running "perl SQL.pl -d" and that should recreate everything.

Hope this helps,

Alex


Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
FWIW: I don't know why the -e syntax doesn't work either, since if I ask it to just print simple text it does... I"m using perl 5.00503

Anyway:

perl
use DBD::mysql;
print "$DBD::mysql::VERSION\n\n";
<CTL-D>

did work, and set the version number off a bit.

Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
I couldn't get that command to work either.... it did not print any value.

I was able to go into the CPAN module, and query it... if you can use CPAN...

perl -MCPAN -eshell
then
Code:
cpan> i DBD::mysql
Bundle Bundle: BD::mysql (JWIED/Msql-Mysql-modules-1.2203.tar.gz)
Module DBD::mysql (JWIED/Msql-Mysql-modules-1.2203.tar.gz)

cpan> b DBD::mysql
Bundle id = Bundle: BD::mysql
CPAN_USERID JWIED (Jochen Wiedmann <joe@ispsoft.de> )
CPAN_VERSION 2.0402
CPAN_FILE JWIED/Msql-Mysql-modules-1.2203.tar.gz
MANPAGE Bundle: BD::mysql - A bundle to install Perl drivers for mSQL or MySQL
CONTAINS DBI, Data::ShowTable, ExtUtils::PerlPP, Mysql, DBD::mysql
INST_FILE /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Bundle/DBD/mysql.pm
INST_VERSION 2.0400

Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
Hello Guru,

Yes this new Mantra did work, as the earlier one was definately hard to recite (eshell and CPAN was not installed on my account/server!)

Now the perl woke up and said :
print $DBD::mysql::VERSION;
2.009902
Is this OK?

perl5 -e did not work!

Moreover, the defs of Links has

package Links::dBSQL::Links;

Is this OK?

Hope I am NOT able to get the Ghost of description row or field out of my database. I cannot see via php3 admin but editor.cgi!

When I wanna add or delete a link, it shifts by one field due to this ghost in there! (Did you design it? It scares me.)

Shall I tell my ISP to delete and create a new database? That would or could be the LAST option, though. I also need to figure out how it happens and that it should not happen to me or also anyone else Smile

Thanks for your Mantras, I beieve in chanting them with faith Smile










[This message has been edited by rajani (edited August 24, 1999).]
Quote Reply
Re: Links SQL BUGS and problems : HELP!!!!!!!!!! In reply to
My version is 2.04 yours is 2.009.. so I think you are a bit old. But if they _were_ working before, wonder why they would have stopped.