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

Help, not work api #65

Closed
FullZero5 opened this issue Mar 6, 2020 · 6 comments
Closed

Help, not work api #65

FullZero5 opened this issue Mar 6, 2020 · 6 comments
Labels
invalid This doesn't seem right

Comments

@FullZero5
Copy link

I use an example from the documentation(allure-docker-service/allure-docker-api-usage/), I specified only the address of my server(allureServer = 'http://.194..24:5050')
Error returned
RESPONSE: { "meta_data": { "message": "local variable 'f' referenced before assignment" } } STATUS: 400
Tell me how to decide in which direction to look for the problem

@fescobar
Copy link
Owner

fescobar commented Mar 6, 2020

@FullZero5 I'm running the example, it's working fine
Can you share your curl or how are you requesting the API including all details?

That url 'http://.194..24:5050' has a dot after //. is that correct?
Can you check if the container is deployed correctly? open your browser and put http://194.xxx.24:5050 you should see SWAGGER documentation.

python3 allure-docker-api-usage/send_results.py
RESULTS DIRECTORY PATH: /Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example
FILES:
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/dummy
Empty File skipped: /Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/dummy
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/dd306793-745a-4d9d-b0a9-0fbbe129dfe4-attachment.mp4
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/e8fa830a-25a2-462c-b7e8-2a7d732e8695-result.json
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/aeae716a-5677-4d24-a403-c3b12fe7b340-container.json
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/e7a01ec3-c4b2-4cab-b335-3cb7dda08f99-container.json
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/605b1288-2d44-4ff6-b9fc-7ba62b56d798-result.json
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/221fb2e8-7bd0-4ea1-b86c-961be98d9c9f-container.json
/Users/frank.escobar/Documents/git/allure-docker-service/allure-docker-api-usage/allure-results-example/44ffbcc0-7d49-49b3-9eab-7e8e2ae67536-attachment
RESPONSE:
{
    "data": {
        "current_files": [
            "10f1a762-7265-478e-9aae-61ba92b5f8a5-container.json",
            "d4389a95-e559-4c4d-8690-ca1b90d8472d-result.json",
            "dummy",
            "dd306793-745a-4d9d-b0a9-0fbbe129dfe4-attachment.mp4",
            "1c14ee67-e50c-4f04-90e8-7aaa2fe26aa3-result.json",
            "e8fa830a-25a2-462c-b7e8-2a7d732e8695-result.json",
            "3b7d014b-25f4-4ebd-9e0e-baba147e6b72-attachment.webm",
            "aeae716a-5677-4d24-a403-c3b12fe7b340-container.json",
            ".gitkeep",
            "708f95f9-06d5-4a87-b849-667d2c1c0f39-result.json",
            "bf55b05d-a357-4558-a45c-dbc2db49d307-container.json",
            "e310a93b-87f9-4e91-aa32-89bfe0625867-attachment.png",
            "56bcb7a9-a867-4aa1-af79-48877265f6a0-attachment.webm",
            "9edf24b3-6618-4e4e-abea-5d5fbb6e8981-container.json",
            "e7a01ec3-c4b2-4cab-b335-3cb7dda08f99-container.json",
            "history",
            "605b1288-2d44-4ff6-b9fc-7ba62b56d798-result.json",
            "28d22ee2-b801-46f8-b442-2708fe9d365f-result.json",
            "1447e367-b03d-44df-b871-356f1b14e07c-attachment.webm",
            "19175c0d-6bf9-4f91-97fb-1e616c17a260-attachment.png",
            "41e52ad4-6134-4ae1-ad90-c2f9da7cd27a-container.json",
            "60d55f24-8819-4c04-a827-2a66b675f74f-attachment.png",
            "2768681c-9929-448a-84f6-8ce8a7d1bb33-attachment.png",
            "221fb2e8-7bd0-4ea1-b86c-961be98d9c9f-container.json",
            "5226a4ce-d53c-4a1f-ad1b-4e5662aeac2e-attachment.webm",
            "44ffbcc0-7d49-49b3-9eab-7e8e2ae67536-attachment"
        ],
        "current_files_count": 26,
        "failed_files": [],
        "failed_files_count": 0,
        "processed_files": [
            "dd306793-745a-4d9d-b0a9-0fbbe129dfe4-attachment.mp4",
            "e8fa830a-25a2-462c-b7e8-2a7d732e8695-result.json",
            "aeae716a-5677-4d24-a403-c3b12fe7b340-container.json",
            "e7a01ec3-c4b2-4cab-b335-3cb7dda08f99-container.json",
            "605b1288-2d44-4ff6-b9fc-7ba62b56d798-result.json",
            "221fb2e8-7bd0-4ea1-b86c-961be98d9c9f-container.json",
            "44ffbcc0-7d49-49b3-9eab-7e8e2ae67536-attachment"
        ],
        "processed_files_count": 7,
        "sent_files_count": 7
    },
    "meta_data": {
        "message": "Results successfully sent"
    }
}
STATUS CODE:
200

@fescobar fescobar added the invalid This doesn't seem right label Mar 6, 2020
@fescobar
Copy link
Owner

fescobar commented Mar 6, 2020

@FullZero5 also you can share your results file to reproduce the error.

@fescobar fescobar added waiting for answer Waiting for user's answer and removed invalid This doesn't seem right labels Mar 6, 2020
@FullZero5
Copy link
Author

FullZero5 commented Mar 10, 2020

Thanks for the quick response. We use the Python script from the documentation.

  1. docker run --name allure -d -p 4040:4040 -p 5050:5050 -e CHECK_RESULTS_EVERY_SECONDS=3 -e KEEP_HISTORY="TRUE" -v "/opt/allure/allure-results:/app/allure-results" frankescobar/allure-docker-service
  2. SWAGGER - works
  3. If I send
    import os, requests, json, base64 allureServer = 'http://*.194.*.24:5050' headers = {'Content-type': 'application/json'} response = requests.get(allureServer + '/clean-results', headers=headers)
    status 200
  4. we use the report files from the example
    `
    python3 send_results.py
    RESULTS DIRECTORY PATH: /home/viktorl/Documents/allure-docker-api-usage/allure-results-example
    FILES:
    /home/viktorl/Documents/allure-docker-api-usage/allure-results-example/dd306793-745a-4d9d-b0a9-0fbbe129dfe4-attachment.mp4
    /home/viktorl/Documents/allure-docker-api-usage/allure-results-example/e7a01ec3-c4b2-4cab-b335-3cb7dda08f99-container.json
    /home/viktorl/Documents/allure-docker-api-usage/allure-results-example/aeae716a-5677-4d24-a403-c3b12fe7b340-container.json
    /home/viktorl/Documents/allure-docker-api-usage/allure-results-example/221fb2e8-7bd0-4ea1-b86c-961be98d9c9f-container.json
    /home/viktorl/Documents/allure-docker-api-usage/allure-results-example/e8fa830a-25a2-462c-b7e8-2a7d732e8695-result.json
    /home/viktorl/Documents/allure-docker-api-usage/allure-results-example/605b1288-2d44-4ff6-b9fc-7ba62b56d798-result.json
    /home/viktorl/Documents/allure-docker-api-usage/allure-results-example/44ffbcc0-7d49-49b3-9eab-7e8e2ae67536-attachment
    RESPONSE:
    {
    "meta_data": {
    "message": "local variable 'f' referenced before assignment"
    }
    }
    STATUS CODE:
    400

`
5) Example them SWAGGER
image

@fescobar fescobar added researching Researching and removed waiting for answer Waiting for user's answer labels Mar 10, 2020
@fescobar
Copy link
Owner

fescobar commented Mar 10, 2020

@FullZero5 I see you are mounting this directory -v "/opt/allure/allure-results:/app/allure-results", can you try using another directory where you have permissions to write?
Even you can try not mounting anything.

I could reproduce the error giving only read permissions to my folder

{
  "meta_data": {
    "message": "local variable 'f' referenced before assignment"
  }
}

@fescobar fescobar added invalid This doesn't seem right waiting for answer Waiting for user's answer and removed researching Researching labels Mar 10, 2020
@FullZero5
Copy link
Author

Thanks for the help! Everything worked, there were no rights to the catalog.

@fescobar fescobar removed the waiting for answer Waiting for user's answer label Mar 10, 2020
@fescobar
Copy link
Owner

#69 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants