semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Problem: Project backup files are not restored correctly

Open Sombeyyy opened this issue 1 year ago • 10 comments

Issue

Project backup files are not restored correctly. After importing the backup file, variables defined in the task templates have disappeared. Recreating the variables in this template results in the following error: "Invalid app_id:" image

Steps to reproduce

  1. Create a project as usual
  2. Create a template as usual and set any number of variables that are required when the playbook is started
  3. Create a backup via Dashboard -> Settings -> Backup
  4. Delete the project drom step 1 or use another semaphore instance
  5. Restore the update via "Restore project..."
  6. Check whether variables are still present
  7. Recreate the variables in the template and then save them

Impact

Other

Installation method

Docker

Database

Postgres

Browser

Microsoft Edge

Semaphore Version

v2.10.22-e44910d-1721658561

Ansible Version

No response

Logs & errors

No response

Manual installation - system information

No response

Configuration

No response

Additional information

Template before the backup image

Template after importing the backup image

Sombeyyy avatar Jul 23 '24 08:07 Sombeyyy

Had the same issue. Fixed by manually adding the label in the NEW column "app" in the "project_template" table the correct app id (which is ansible)

Edit: got this issue after an update

kevingavran avatar Jul 30 '24 08:07 kevingavran

This affects more than just variable modification. Semaphore fails to Run any/all Tasks in a restored project because Semaphore doesn't know what to execute: Running app failed: exec: no command.

ezekiel avatar Jul 31 '24 19:07 ezekiel

Yea got it working again after altering the db

kevingavran avatar Aug 01 '24 06:08 kevingavran

same here. Is there any quick solution? restoring project completely useless now.

alphkn avatar Aug 27 '24 21:08 alphkn

Same for me. Restore is not working anymore since 2.10 and the ability to launch different apps.

Running app failed: exec: no command

terman37 avatar Aug 30 '24 13:08 terman37

For me it was the browser cache, just try a different browser.

christianbur avatar Sep 07 '24 06:09 christianbur

Hello, I encounter the exact same issues in version 2.10.22-e44910d-172165829 Another symptom of the same root issue is this icon being displayed (proof that the restored template has no "type" defined) image

And here's another way to present the issue : The projects restore API endpoint should show a property to define the type of task in templates image And of course the export button in the UI should generate a json file presenting this new property

As mentioned earlier the Backup/Restore features are totally unusable right now. I think it's not the first time this set of feature breaks or that the API doc for this endpoint is not updated, maybe some automatic tests should added ?

Thank you for supporting this project !

pierrediancourt avatar Sep 19 '24 08:09 pierrediancourt

I encountered the same issue as I use an ansible task to create semaphore templates over the API.

the missing key for that (and likely the restore) is app and should be set to ansible in my case (as these are ansible templates).

@fiftin it would be great if you could do pre-check tests in your build tests like that. if you can create a template over the API and are able to RUN it it would be good indicator that both restore and the API act as expected?!

for those who wanna know the quick and dirty fix:

use semaphore;
select name from project__template where app = "";
update project__template set app = "ansible" where app = "";

steadfasterX avatar Oct 04 '24 13:10 steadfasterX

Hi @steadfasterX,

The backup functionality isn't working properly. I'm fixing it right now.

fiftin avatar Oct 05 '24 10:10 fiftin

Hi,

This issue is resolved with the latest 2.10.30 release I still recommend to :

  • update https://semaphoreui.com/api-docs/#/projects/post_projects_restore

And for the long run it would be great to do the following as part of the release process:

  • automate the testing of API endpoints such as this one
  • regenerate/redeploy the API endpoint doc as it's "Swagger-Powered"

Thank you very much for the fix @fiftin 🙏

pierrediancourt avatar Oct 16 '24 15:10 pierrediancourt

Hi! On semaphoreUI v2.10.43, clicking on the project restore button does a GET on http://server:port/api/project/restore which results in a 404 error. It should be /api/projects/restore (projects plural instead of singular).

Hugobox avatar Dec 19 '24 18:12 Hugobox

Restore is a critical use-case, has this been fixed?

bbaassssiiee avatar Apr 16 '25 04:04 bbaassssiiee