Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.sh error #28

Closed
landiDev opened this issue Sep 5, 2020 · 21 comments
Closed

setup.sh error #28

landiDev opened this issue Sep 5, 2020 · 21 comments

Comments

@landiDev
Copy link

landiDev commented Sep 5, 2020

Hello,

I tried installing OpenCast and upon starting setup.sh I get the error:
setup.sh: 7: setup.sh: bad substitution
I tried removing ,, from the 7th line I get another error
setup.sh: 11: setup.sh: Syntax error: "(" unexpected

Is this supposed to be run with sudo sh setup.sh or something else?
If I ran it correctly, how can I fix the error?

@Tastyep
Copy link
Owner

Tastyep commented Sep 5, 2020

Hello,

Thank you for the issue, you are the first one, congrats!
The line was containing non-POSIX commands which I've replaced on the master branch.
You can use sudo, otherwise, the script will ask for privileges to run the commands requiring it.

Can you please tell me what operating system and bash version do you have?
If you use a non-debian / ubuntu based system you will have another error when installing the system dependencies using apt-get. Commenting the lines will fix the problem, the dependencies are rather common.

Also, you might be interested in checking at the develop branch which is stable and more advanced in terms of features.
If you do so, sorry in advance for the overflowing list of videos :)

Thank you again for your interest in the project!

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

Hello,

I am running Raspbian Buster based on Debian 10,
Bash 5.0.3.

I have tried the develop branch, but I get the same problem,
the error seems to be in the creation of any function.
setup.sh: 11: setup.sh: Syntax error: "(" unexpected

I am guessing that I need to upgrade/downgrade my bash.
Thanks for the help!

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

Thank you for the information.
I think I got it fixed (both master and develop), you will have to pull the change and I'll wait for your feedback.
On my side, I also have Raspbian with Bash 5.0.3, but I can't reproduce the error :(. However, it seemed to be a basic syntactic error.
Hopefully, this will be your last problem.

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

Hello,

I have tried the master branch setup.
It runs now, but gives these errors
2020-09-06-110017_1920x1080_scrot
There are some errors saying that I dont have Python 3.7, I do, not sure whats that all about.
And there is apparently an error when trying to create a virtualenv.

I tried to go onto port 8081 of my Raspberry and I get the UI but when trying to play anything It just says Error:
No error displayed but there is apparently an error, here is a screenshot just in case
2020-09-06-110624_1920x1080_scrot

What Raspberry are you using, I have a Raspberry Pi 4.
Since I upgraded from my Raspberry Pi 3 to a 4 I have noticed that 3 different casting packages will not work, even tho they worked on the 3. Im not sure how has that impacted anything.

Should I do a pull request, Im not really sure for its purpose since I havent used GitHub in a while.

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

Hello,

Your errors seem all to be related to the python version that is being used.
Can you run python3 --version? My output is Python 3.7.3

EDIT: I see you execute the setup script using sudo sh setup.sh, prefer sudo ./setup.sh or better ./setup.sh

I strongly suggest that you switch on the develop branch (you will need to re-execute the setup script if you do so), you will benefit from the new interface (even though a problem remains).

No need for a pull request, no worries.
I run my CI on ubuntu and while it's not exactly the same as raspbian, it is very close. This indicates that something is different with your environment, let's find out what causes the problem.

Thank you for your time.

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

A preview of the new interface:
Screenshot_2020-09-06_11-37-40

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

Hello,

My output for python3 --version is Python 3.7.0
I am trying the develop branch with ``

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

sudo ./setup.sh
Sorry, dont know what happened there

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

Hello,

I have tried the develop branch with sudo /setup.sh
It gives me the same errors for python and for trying to create a virtualenv

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

The UI Appears, but trying to cast doesnt do anything

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

Is there any logs I would be able to send you?

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

Ok I found the issue, do not execute the setup script using sudo, just do ./setup.sh

The setup instruction in the README file on develop had been updated to be clearer, so I can understand how you ran into this:
Screenshot_2020-09-06_11-55-26

Also, since there is no immediate feedback on the interface you can tail the logs of the service, to do so:
./OpenCast.sh service back log

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

Alright, trying it now. If there is an error I will send you the log
Also, shouldnt it be
git clone --branch develop https://github.com/Tastyep/Pi-OpenCast.git for the develop branch

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

Since I do my releases on master it is not necessary, the releases should be stable while the develop branch doesn't guarantee it.
However with the way it's been I consider the develop branch to be more stable as more tested (thanks to Github actions)
Normally I expect to be a few days away from fixing that last problem on the interface and making a new release.

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

2020-09-06-122433_1920x1080_scrot
Logs not found,
When Installing the same error remains for the virtualenv.
UI Still works, but gives no response

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

As long as the setup fails the service won't start which explains why you don't have logs.
Can you please provide a complete screenshot of the setup log when doing ./setup.sh?

@landiDev
Copy link
Author

landiDev commented Sep 6, 2020

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

I may have some hints about why this happens, can you run
source ~/.profile; poetry shell
I expect that you get the same error.
This issue seems to be related to your problem.
Also, can you provide the version of poetry causing the issue ? poetry --version
Maybe running poetry self update --preview could help you, if you do so, try again running poetry shell and see if the problem persists.
If this works, comment install_system_deps in setup.sh and try running it again.

@Tastyep
Copy link
Owner

Tastyep commented Sep 6, 2020

I've reinstalled Opencast on my rPi and don't have the issue, so I expect you not to have it too.
Again, can you run the setup script ./setup.sh and provide a screenshot ?

The log should contain some differences.
What I'm looking at especially is the Runtime warning (above the brown colored line), while not important (I have it too), it shows where poetry is installed. If it is installed as root: /root/.poetry/... then the setup will fail, I was able to reproduce this when running sudo ./setup.sh

On my setup by NOT running the script as sudo I get:
`

Installing project dependencies...
Checking for updates.
/home/pi/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
"program uses threads.", RuntimeWarning)
Updating dependencies
Resolving dependencies...
`

@Tastyep
Copy link
Owner

Tastyep commented Sep 7, 2020

I forgot to remove the virtualenv while reinstalling ... then ran into the same problem as you.
poetry self update --preview worked for me, I hope it did for you too.
It is bad luck because Poetry is a very good tool.

Please tell me if you managed to set up the application so I can close this issue.

@landiDev
Copy link
Author

landiDev commented Sep 8, 2020

Hello,

Sorry for the late reply, that fixes it.
Thanks.

@landiDev landiDev closed this as completed Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants