Fossil Forum

Setup needed to move local "remote" repository to a server
Login

Setup needed to move local "remote" repository to a server

Setup needed to move local "remote" repository to a server

(1) By anonymous on 2023-06-04 15:01:27 [link] [source]

This is a follow-on to https://fossil-scm.org/forum/forumpost/8161cf23dd (waiting for approval for it to post)

My server died and I needed to rebuild it. I have my local fossil repository file.

The docs led me to believe that all I need to do is to copy the repository file. 'With the repository secured, it is safe to upload a copy of the repository file to your server and proceed with server setup' followed by a link to the fossil server incantation I've been using all along.

But after I copied the local file over to the server, as the link states, I get a series of errors:

SQL: INSERT INTO config(name,value,mtime)VALUES('baseurl:https://REDACTED',1,now())
HTTP_HOST=REDACTED
HTTP_USER_AGENT=Fossil/2.22 (2023-05-31 15:26:08 [66ee0beb9b])
PATH_INFO=/
REMOTE_ADDR=REDACTED
REQUEST_METHOD=POST
REQUEST_URI=/
server says: 400 Bad Request
Pull done, wire bytes sent: 372  received: 1000  remote: REDACTED

Interestingly, the .fossil file copied onto the server continues to be configured to act as a 'user', and is trying to sync with the server.

I'm not sure what options I have here. I cannot even "open" the repository on the server without the above crash, so what can I do here?

(2) By anonymous on 2023-06-04 16:35:49 in reply to 1 [source]

If I host the repository via fossil server (using public key encryption) and access the repo via the browser, I get

Database error: attempt to write a readonly database: {INSERT INTO config(name,value,mtime)VALUES('baseurl:https://REDACTED',1,now())}
This page was generated in about 0.007s by Fossil 2.22 [66ee0beb9b] 2023-05-31 15:26:08 

(4) By Warren Young (wyoung) on 2023-06-05 07:53:37 in reply to 2 [link] [source]

Is the directory holding the repo file writable by the owner of the "fossil server" process?

If yes, are you sure? Have you accounted for SELinux/AppArmor/other oddball MAC systems?

(5) By anonymous on 2023-06-05 14:36:29 in reply to 4 [link] [source]

I'm on root on FreeBSD. As an exercise I wrote a little fopen program with "w" mode on the file and the syscall succeeded.

(6) By anonymous on 2023-06-05 14:38:16 in reply to 4 [link] [source]

Ah, I misread the question.

Here is the ls -l listing for the directory: drwxr-xr-x 2 root wheel 5 Jun 5

And the user root issued the command.

(7) By Warren Young (wyoung) on 2023-06-05 14:44:28 in reply to 6 [link] [source]

Then you're subject to the chroot jail rules. If another user owns the file in that directory, it would explain your situation perfectly: Fossil will chroot as that user, then not have write access to the directory because root owns it.

Try starting Fossil as "fossil server --nojail". It's a bad idea to run fully as root, but even if you agree with me that this is not how you want Fossil to run, it would be diagnostically useful to know if this makes the symptom go away.

(8) By anonymous on 2023-06-05 15:39:43 in reply to 7 [link] [source]

That was the reason, thanks!

(3) By anonymous on 2023-06-04 16:39:52 in reply to 1 [link] [source]

Even stranger,

if I create a new directory on my local machine, copy the repository file there, and then

fossil open repo.fossil

I get

Pull from REDACTED
server says: 400 Bad Request
Pull done, wire bytes sent: 369  received: 1000  remote: 45.56.96.180
Autosync failed.
continue in spite of sync failure (y/N)? y
[all of the files in the repo appear]