Legacy using Docker and legacy install issues

Git is a Version Control System. Its purpose is to keep track of changes people made to files in a specific directory. You typically have Local and Remote versions of a repository (the directory containing tracked files). The Local repository lives on your computer, the Remote somewhere else (in this case: GitHub).

git checkout legacy is like loading the saved file “legacy”: it will set all files in your directory to how they are specified in the saved state. You can then either directly run these files, or use them to build a new Docker Image. Your Docker Image will not be automatically changed when you use git checkout.

Thanks for the info. That does help.

So I followed the instructions, and it worked reverting to the legacy build but now there is a new issue.

The Script is not running. If I click on the button for the Script Start/Stop, nothing happens.
And in the logs I get:
Error: Received invalid message on socket: getTemperatures

FYI, right now I just have one temperature sensor connected to the arduino and it is being recognized in the Device list. So I’m not sure what that error is.

Any thoughts?

Additionally, I looked through some other posts here that had the similar problem so I ran fixPermissions.sh and got this:

root@4c8c7ffc5383:/home/brewpi# sudo bash /home/brewpi/utils/fixPermissions.sh

***** Fixing file permissions for /var/www *****

***** Fixing file permissions for /home/brewpi *****

chown: invalid user: ‘brewpi:brewpi’

*** ERROR ERROR ERROR ERROR ERROR ***

----------------------------------

See above lines for error message

Script NOT completed

chown dir username sets the ownership of a directory.

You’re in a root shell. You’ll likely want to exit that before running the script.

Ah okay. Could you please elaborate on that?

What should I be doing from /home/brewpi ?

The script likely uses current user (brewpi). You’re logged in as the superuser (can do everything) account “root”. This may mess with some scripts that assume you’re the normal user.

May want to google “root shell”, or “exit root terminal” for explanations.

I’m sorry but I’m not sure I understand.
I have ssh’d into the docker container ‘brewpi’ so that I can run the script for fixPermissions.sh
I am running it from /home/brewpi/

I’m not sure what to do with chown dir username. What user name do I use? I don’t recall setting any, other than for brewpi port81.

Close and restart your ssh session, but now prepend the address with brewpi@. ssh address becomes ssh brewpi@address

Forget what Bob said and forget about fixing permissions. Bob didn’t realize you were running things inside the docker container, where things are running as root. Bob knows everything about our new BrewBlox system, which he built. This is the old stuff were things are not as nicely built. :slight_smile:

You have switched the brewpi-script repository to legacy, but have not yet switched the brewpi-www repository. You are getting an error because the versions don’t match.

Enter the container with:

docker exec -it brewpi /bin/bash

Then run

cd /var/www/html
git stash
git checkout legacy

Ah I see. Thanks for the clarification.

Elco,
I’m pretty sure both the dirs have been successfully changed to legacy. I’m still finding that the script is not running.

:frowning:

If you are sure, force refresh the UI (ctrl-F5) or open it in a private window.
Or run git status in both dirs to check that you have succeeded.

Note that by choosing a DIY build based on software we deprecated in 2015, you’re not taking the easy path. We don’t fix any bugs, add any features or offer any support for the discontinued Arduino version.

Yes I completely understand and looking into a proper solution. I appreciate the help really.

I had to reboot the pi. I did as per your instructions.
First I checked git status on home/brewpi and var/www/html/ and this is what I got:

  root@4c8c7ffc5383:/var/www/html# git status
    On branch legacy
    Your branch is up-to-date with 'origin/legacy'.
    Changes not staged for commit:
      (use "git add/rm <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    data/.gitignore
	deleted:    data/Sample Data/Sample Data-2012-09-26.json
	deleted:    data/Sample Data/Sample Data.csv
	deleted:    data/profiles/Sample Profile.csv

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	data

no changes added to commit (use "git add" and/or "git commit -a")
root@4c8c7ffc5383:/var/www/html# cd ..
root@4c8c7ffc5383:/var/www# cd ..
root@4c8c7ffc5383:/var# cd ..
root@4c8c7ffc5383:/# cd home/brewpi/data
root@4c8c7ffc5383:/home/brewpi/data# git status
fatal: Not a git repository (or any parent up to mount point /data)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
root@4c8c7ffc5383:/home/brewpi/data# cd ..
root@4c8c7ffc5383:/home/brewpi# git status
On branch legacy
Your branch is up-to-date with 'origin/legacy'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    data/.gitignore
	deleted:    data/Sample Data/Sample Data-2012-09-26.json
	deleted:    data/Sample Data/Sample Data.csv
	deleted:    logs/.gitignore
	deleted:    settings/.gitignore
	deleted:    settings/config.cfg.example
	deleted:    settings/defaults.cfg
	deleted:    settings/tempProfile.csv

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	data
	logs
	settings

no changes added to commit (use "git add" and/or "git commit -a")

Note that git stash is yielding me these lines:

root@4c8c7ffc5383:/home/brewpi# git stash
error: 'data/.gitignore' is beyond a symbolic link
fatal: Unable to process path data/.gitignore
Cannot save the current worktree state

On the webserver, I’m still at Script not running and the logs are now saying:

Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 183, in 
dontRunFilePath = os.path.join(config['wwwPath'], 'do_not_run_brewpi')
File "/usr/local/lib/python2.7/dist-packages/configobj.py", line 554, in __getitem__
val = dict.__getitem__(self, key)
KeyError: 'wwwPath'

Device Configuration now yields nothing, no devices are listed now.
The device config log says:

Error while receiving device configuration: SyntaxError: Unexpected token C in JSON at position 0

Your /home/brewpi directory is up to date with legacy, so you can ignore the git stash fail for now. Next step is to follow Elco’s code to checkout the legacy version in /var/www/html.

He did that, but I’m not sure he also did it in the www dir.
Try a ‘git reset --hard’ in both directories to undo any changes you made.

You deleted the default settings

Okay so today I tried ‘git reset --hard’ on both dirs, and then reloaded the webpage and it worked just fine - everything seemed to be normal, logs were fine and devices working properly. I was happy. Then I started a new brew - set a new name and reloaded the page and boom, script not running again. Logs now say - can’t find log file.
Device configuration gives me a missing token in json file error.
I did try removing browser cookies and reloading to check if that was showing me an older cached result but no it does not run again, even on another browser. I had 2 minutes of up time thats it.

:frowning: :frowning: :frowning:

Tried reloading again, I created the two log files manually, now I get the following errors in logs:

Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 183, in 
dontRunFilePath = os.path.join(config['wwwPath'], 'do_not_run_brewpi')
File "/usr/local/lib/python2.7/dist-packages/configobj.py", line 554, in __getitem__
val = dict.__getitem__(self, key)
KeyError: 'wwwPath'

I tried git reset --hard again and reloaded the browser again and that seemed to work. It was working but I noticed that the UI does not reflect any of the name changes to profiles. I then tried to stop the script and restart it just to see if that was the issue and yes it was. Now the script does not run again.

Going by these instabilities, we are considering getting the Spark 3.
Looking at the setup, what kind of pluggable terminals do we need to connect the relays cabling to the Spark?
I don’t see them at the BrewPi store. Could you give us some technical info about them so we can buy them in India where we are located?
If that’s sorted then I think we should be able to buy everything else from the BrewPi store.

Thanks!

They are included with the Spark.

Oh great! We will place an order.

Thanks.