flipswitchingmonkey / gitea-spk

spk (Synology package) to install gitea into Synology NAS
MIT License
105 stars 23 forks source link

Installation fails on DS414 (DSM 6.2.2-24922 Update 2) #24

Open dream09 opened 5 years ago

dream09 commented 5 years ago

Thank you for putting this together with a great guide! I'm unable to install on my DS414 (amardaxp ARM7). I've packaged up various versions of gitea and tried to manually install. It always looks like all is going well, I get the "Installing" progress prompt for a minute or two, but then I always get the message 'Failed to install "Gitea".'

image

I have pulled the logs from my DS414 (/var/log/packages/gitea.log and /var/log/synopkg.log) and the only lines shown are:

2019/07/28 22:35:57 install Gitea 1.8.3 Begin preinst 2019/07/28 22:35:57 install Gitea 1.8.3 End preinst ret=[1] 2019/07/28 22:35:57 install Gitea 1.8.3 Begin /bin/rm -rf /volume1/@tmp/pkginstall 2019/07/28 22:35:57 install Gitea 1.8.3 End /bin/rm -rf /volume1/@tmp/pkginstall ret=[0] 2019/07/28 22:35:57 install Gitea 1.8.3 failed

Any help would be very much appreciated.

Kasurus commented 5 years ago

Have you tried older arm7 builds with this version of gitea-spk?

There is also a arm7 build for Gitea v1.8.3 out there that you could try.

dream09 commented 5 years ago

Thanks for the guidance. I've been able to build and install arm7 builds with the version of gitea-spk that you suggested. However I've hit another issue in that I cannot start Gitea. When I hit the Run button in DSM it looks like it's starting but then shows that it is stopped. I can't access Gitea on port 3000. I found this in the logs, looks like it's trying to get going after installing.

2019/07/30 22:38:37 install Gitea: begin to start version 1.8.1 2019/07/30 22:38:38 install Gitea 1.8.1 Begin pre-load apparmor 2019/07/30 22:38:38 install Gitea 1.8.1 End pre-load apparmor ret=[0] 2019/07/30 22:38:38 install Gitea 1.8.1 Begin start-stop-status start 2019/07/30 22:38:38 install Gitea 1.8.1 End start-stop-status start ret=[0] 2019/07/30 22:38:40 install Gitea: start version 1.8.1 successfully, result 0 2019/07/30 22:39:07 start Gitea: begin to stop version 1.8.1 2019/07/30 22:39:08 start Gitea 1.8.1 Begin start-stop-status stop 2019/07/30 22:39:08 start Gitea 1.8.1 End start-stop-status stop ret=[0] 2019/07/30 22:39:08 start Gitea 1.8.1 Begin unload apparmor 2019/07/30 22:39:08 start Gitea 1.8.1 End unload apparmor ret=[0] 2019/07/30 22:39:08 start Gitea: stop version 1.8.1 successfully, result 0 2019/07/30 22:39:08 start Gitea: begin to start version 1.8.1 2019/07/30 22:39:09 start Gitea 1.8.1 Begin pre-load apparmor 2019/07/30 22:39:09 start Gitea 1.8.1 End pre-load apparmor ret=[0] 2019/07/30 22:39:09 start Gitea 1.8.1 Begin start-stop-status start 2019/07/30 22:39:09 start Gitea 1.8.1 End start-stop-status start ret=[0] 2019/07/30 22:39:11 start Gitea: start version 1.8.1 successfully, result 0

Kasurus commented 5 years ago

Just to make sure, you have the "Git Server" package installed from the Synology package centre?

At this point i would ssh into the Synology DS and try to find a log that holds more information. There should be a gitea logfile in /usr/local/gitea/gitea/gitea.log but you could find better info in some system log.

dream09 commented 5 years ago

Yes I have Git Server installed :) I'm using it already for some repos. I thought I'd give Gitea a go as it has a nice interface rather than having to create new repos with ssh. I've used ssh and gone in as root. I can't see any gitea folder in /usr/local/ ? Could this be the problem? Is it actually installing? I see from the scripts/installer file that INSTALL_DIR="/usr/local/${PACKAGE}". So I'm assuming there should be a gitea folder in here? The only logs I can find are in /var/log/packages. There's a Gitea.log and that's where the the last output I posted came from.

dream09 commented 5 years ago

I've made some progress and got it installing in /usr/local and accessed the gitea.log. There seems to be a permissions error when it tries to launch: /var/packages/Gitea/scripts/start-stop-status: line 28: /usr/local/gitea/gitea/gitea: Permission denied

This relates to: ${gitea} web > ${LOG_FILE} 2>&1 &

These are the permissions: image

Do the permissions need updating?

Kasurus commented 5 years ago

/usr/local/gitea/gitea

gitea_permissions

Yes, looks like your permissions got messed up. You could use chown to fix it or delete the hole folder and try a fresh install.

(Some files like key.pem and cert.pem should not be in your folder, even if the install went fine.)

icnicl commented 5 years ago

I also have trouble installing gitea to my diskstation ds213j. I also get the message 'Failes to install"Gitea"'

I pulled the log files (message)

synoscgi_SYNO.Core.Package.Installation_1_install[18504]: process.cpp:236 Failed to run preinst, ret=[-1], No such file or directory
synoscgi_SYNO.Core.Package.Installation_1_install[15476]: pkginstall.cpp:481 Failed to run preinst script for Gitea, 1

synopkg.log:

2019/10/07 22:26:22 install Gitea 1.8.3 Begin preinst
2019/10/07 22:26:22 install Gitea 1.8.3 End preinst ret=[1]
2019/10/07 22:26:22 install Gitea 1.8.3 Begin /bin/rm -rf /volume1/@tmp/pkginstall
2019/10/07 22:26:23 install Gitea 1.8.3 End /bin/rm -rf /volume1/@tmp/pkginstall ret=[0]
2019/10/07 22:26:23 install Gitea 1.8.3 failed

I've also tried to build it with the another version gitea-spk, but this work neither.

Any suggestions? What does "No such file or directory" mean? Can't process.cpp access the preinst script. Is that possibly a problem with permissions? And if yes, how can I fix it?

thx

dream09 commented 4 years ago

Better late than never! I've finally had some time to look into this and have found a way to get this working. Here are the steps I took, hopefully they will help anyone else having this issue.

  1. Download previous version of gitea-spk as suggested by @Kasurus.
  2. Download the latest ARM6 version of gitea (I used v1.10.3).
  3. Once downloaded change the name of the file to xxxxx-arm7 for example gitea-1.10.3-linux-arm-7.
  4. Place the renamed file in the gitea-spk folder and follow the gitea-spk README instructions to create the package.
  5. Log into your Synology and manually install the package (spk file) created in step 4. Ensure that you do NOT select the box that will run Gitea after installation.
  6. Once installed access your Synology via SSH (I used Remote Terminal from the Microsoft store). You can use your Synology admin username and password to access.
  7. Access the /usr/local/gitea/gitea/ folder.
  8. View info about the files in this folder using ls -l. The file gitea should have the following permissions: image
  9. Correct the permissions of the gitea file using chmod, I used this command: sudo chmod 775 gitea
  10. Log out of SSH.
  11. Log back into your Synology and start Gitea in DSM Package Manager. Once running you can access Gitea and complete setup - enjoy!
gaetandezeiraud commented 4 years ago

@dream09 Thanks! Fixed with your solution for my DS220J.