Author Topic: Network - connect to server - 401 Error - (Updated)  (Read 17461 times)

0 Members and 1 Guest are viewing this topic.

Offline Markk

  • Member
  • *
  • Posts: 13
    • View Profile
Network - connect to server - 401 Error - (Updated)
« on: May 24, 2012, 07:57:00 am »
Having issues getting it to run from a network machine
After much Failing, Searching, More Failing, and the such... and finally found this thread http://www.videodb.info/forum_en/index.php/topic,1696.40.html
great help there solved most of my issues...
Last Error 401 - due to resource not shared - hence why moved as below

LOCAL PC (Marks-PC)
Windows 7 Home (192.168.1.66)
PVD 1.0.2.3 Beta
Installed Firebird-2.5.1.26351_1_Win32 on Local Machine
Moved Database to local shared folders path C:\Users\Public\Documents

Wifes Lan Computer
(Win 7 home + PVD 1.0.2.3 Beta)
Connect to server
192.168.1.66:C:\Users\Public\Documents\MOVIES.pvd

From Wifes PVD just now crashes
Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:   viddb.exe
  Application Version:   1.0.2.3
  Application Timestamp:   4f777337
  Fault Module Name:   fbembed.dll_unloaded
  Fault Module Version:   0.0.0.0
  Fault Module Timestamp:   4e89568b
  Exception Code:   c0000005
  Exception Offset:   060ab0a8
  OS Version:   6.1.7601.2.1.0.768.3
  Locale ID:   5129
  Additional Information 1:   0f31
  Additional Information 2:   0f3137665bbf0bb676c8a16f3fa76e52
  Additional Information 3:   734c
  Additional Information 4:   734ccfe73f17be1bff15d862f90cba92

Any Suggestions ?

EDIT Crashing solved was using \\Computer Name:......  \\ = instant program crash
« Last Edit: May 24, 2012, 10:04:14 am by Markk »

Offline Markk

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Network - connect to server - crashing PVD
« Reply #1 on: May 24, 2012, 08:59:25 am »
Update - More farting around and just getting 401 errors - have moved Movies.pvd to other locations on local machine under fully shared r/w dir locations and still no joy

Possibly the Firebird client is not running correctly - no idea how to check this out

Maybe ill just have to sync the Database across the network from time to time - kinda totally defeats the purpose of the wife adding notes/rating etc...

also in the 401 error - ref to 13:98 a file in the firebird dir so i will reinstall it see what happens

It will some simple stupid thing i have overlooked
- its always the easy stuff that's so complex in simplicity


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Network - connect to server - crashing PVD
« Reply #2 on: May 24, 2012, 09:19:52 am »
Welcome.

Quote
Any Suggestions ?

A stab in the dark... I may not understand the 'problem signature', but I wonder about...

Quote
Fault Module Name:   fbembed.dll_unloaded

That's the embedded Firebird, which shouldn't be involved if the server is being used.

Did you use the Firebird Server Manager (a Control Panel applet) to start the Firebird service? Are you sure it's running? Check in Resource Monitor or Process Explorer.

I find PVD finicky when it comes to changing from a local connection (i.e., using Firebird Embedded) to the server. Sometimes I have to load some other database, then enter the server connection string to the original database.

Sorry, I don't know what the 401 errors are about, but...

Quote
Possibly the Firebird client is not running correctly - no idea how to check this out

...maybe we're both right. ;)

Offline Markk

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Network - connect to server - crashing PVD
« Reply #3 on: May 24, 2012, 09:54:56 am »
Ty for your quick Response

Originally crashing was occurring from the lan pc trying to get to the shared Movie.pvd file (now just 401 errors)

FireBirdDefaultInstance - Service is running - confirmed by task manager /services

Full details on the error 401
---
Fail to open database
ErrorCode: 401
Unable to establish a connection.
can't format message 13:98 -- message file c:\Program Files\firebird.msg not found
Error Code: 401
---
Just to confirm in doing the right amount of silly

2 computers  - PVD installed on both
1st Computer - Local PC Firebird installed and Database file
2nd computer - LAN trying to connect to database using - Connect to server - Option in PVD

Failing miserably

Have tried loading empty DB on Local PC, with the PVD program open / closed

Do I need to do something else ? ¿

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #4 on: May 24, 2012, 10:12:43 am »
Quick shot. Did you modify the configuration file of the server?

Quote
# ----------------------------
# Remove protection against opening databases on NFS mounted volumes on
# Linux/Unix and SMB/CIFS volumes on Windows.
#
# This also permits creating database shadows on mounted network volumes.
#
#     ***WARNING*** ***WARNING*** ***WARNING*** ***WARNING***
#
# This option removes an important safety feature of Firebird and can
# cause irrecoverable database corruption. Do not use this option unless
# you understand the risks and are prepared to accept the loss of the
# contents of your database.
# Unless this configuration option is changed from 0 to 1, Firebird can
# open a database only if the database is stored on a drive physically
# attached to the local computer - the computer running that copy of
# Firebird. Requests for connections to databases stored on NFS mounted
# drives are redirected to a Firebird server running on the computer that
# "owns" the disk.
# This restriction prevents two different copies of Firebird from opening
# the same database without coordinating their activities. Uncoordinated
# access by multiple copies of Firebird will corrupt a database. On a local
# system, the system-level file locking prevents uncoordinated access to
# the database file.
#
# NFS does not provide a reliable way to detect multiple users of a file on
# an NFS mounted disk. If a second copy of Firebird connects to a database on
# an NFS mounted disk, it will corrupt the database.
# Under some circumstances, running a Firebird server on the computer that
# owns NFS mounted volumes is inconvenient or impossible. Applications that
# use the "embedded" variant of Firebird and never share access to a database
# can use this option to permit direct access to databases on NFS mounted
# volumes.
#
# The situation for SMB/CIFS is quite similar to NFS with not all configurations
# providing file locking mechanisms needed for safe operation. Using SuperServer
# engine with the database on NT file server may be considered relatively safe
# as file locking protects the database from being used by the several engines.
# Network stack can still change order of writes so you may get a corrupted
# database in case of network errors or power outage.
#
# The useful and safe case is working with a shared database marked read-only.
#
# DO NOT ENABLE THIS OPTION UNLESS YOU REALLY KNOW WHAT YOU ARE DOING.
#
# Type: boolean
#
#RemoteFileOpenAbility = 0

Offline Markk

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #5 on: May 24, 2012, 10:36:29 am »
Goddert - No

Update: As noted by Buah in his post: http://www.videodb.info/forum_en/index.php/topic,1696.40.html he referred to port 3050 - I added an exception to windows 7 firewall to allow traffic

Note: 192.168.1.66:C:\Dump\MOVIES.pvd - Worked to open database
but: MARKS-PC:C:\Dump\MOVIES.pvd - Failed to open database

So 1/2 Solved can now open 1 version at a time from either PC
If the PVD is open on 1 PC then it locks the DB

Failed to open database Errorcode 664 .... database is probaly already open in another engine instance in another windows session ... blah blah

It this working as intended? is this a limitation? or is something still not right?
At least its kinda working


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #6 on: May 24, 2012, 10:49:11 am »
Quote
or is something still not right?

Right. The very point of a server, of course, is to support multiple connections. Both instances of PVD have to be connected via the Server. If one of them is connected via the embedded version, that will lock the database. Does that help?

Offline Markk

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #7 on: May 24, 2012, 11:10:44 am »
As I Thought - yes your right
Also From Local PC:  192.168.1.66:C:\Dump\MOVIES.pvd - working as intended

Now to set this up on my friends computer...  ;)
Thanks everyone for your help - see it was simplistic after all...

So Basically from the Top in order to Run PVD from Multiple Computers on a typical LAN

1) Install PVD on all computers
2) Install Firebird on Master PC
3) Set UP Database on Master PC (must be a local drive - not on a network share or NAS)
4) On Master PC Open Port 3050 in your firewall to accept local traffic
5) Get your Path Information Correct (ie start run - cmd - ipconfig get your PC IP for Master PC) so you will use IPaddress:Location  ie(192.168.1.66:C:\Dump\MOVIES.pvd)
6) on all Computers Use the Connect to server and use the 5) correct Path ie(192.168.1.66:C:\Dump\MOVIES.pvd)


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #8 on: May 24, 2012, 11:21:27 am »
Well done. Thanks for sharing the correct method.

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #9 on: May 24, 2012, 11:35:48 am »
Warning... the locking mechanism on NFS/SMB shares isn't safe (except with super server - but this is overkill for PVD). So be sure your database is always locally attached to your server machine (physical drive of the server machine). E.g. accessing concurrently with two servers to a shared db isn't save and destroys your data.
In a scenario like this you should consider your use case. How often do you change the db? Maybe a solution with a regular synchronization would be more convenient. In the end it's only one file.
Or use, e.g., a php framework. Nice with tablets in front of the TV :)

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #10 on: May 24, 2012, 11:48:05 am »
Quote
In a scenario like this you should consider your use case.

I don't understand. Even if it's possible, why would he be accessing any database with two servers? And if using one server, why would a locking mechanism matter?

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #11 on: May 24, 2012, 12:14:36 pm »
A,B,C,D,E = different machines
A = DB Server 1
B = DB Server 2
C = DB
D = Client 1
E = Client 2

D can talk only to A and E can talk only to B. You want to use only one db (C). A and B both can talk to C. This is the case in many production environments of databases. But it doesn't work with NFS/SMB shares because locking isn't safe with the classic server. With one server the locking mechanism matters (if db is not locally attached) as latency on NFS/SMB shares is slow and if you send two concurrent commands it may fail.

Post is old but still valid:
http://forums.devshed.com/firebird-sql-development-61/firebird-and-networkdrives-under-win32t-227963.html

Firebird FAQ page 22
http://firebirdsql.org/pdfmanual/Firebird-2-QuickStart.pdf

I didn't want to scare anyone but to issue a warning if someone is considering a setup like this.

Offline Markk

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Network - connect to server - 401 Error - (Updated)
« Reply #12 on: May 24, 2012, 02:01:27 pm »
Quote from your link "...Seriously, if another Firebird server access the same file (that is, IF you can get it to work), you will experience instant database corruption."

But for the rest of us typical home users - yes some have elaborate home networks but would only be using 1 Firebird Server to share a database or 2
A Typical Home LAN Network use may be...

A = Server DB read write (media PC always on in lounge running Firebird)
B = Client read write - Main PC used to import edit data
C = Client read write - 2nd PC occasional edit data
D = Client read only - kids PC
E = Remote internet access read only - friends or work access

In this instance it would be safe and work as intended