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

upload function is abnormal #171

Closed
yueqi77 opened this issue Nov 27, 2023 · 36 comments
Closed

upload function is abnormal #171

yueqi77 opened this issue Nov 27, 2023 · 36 comments
Labels

Comments

@yueqi77
Copy link

yueqi77 commented Nov 27, 2023

Describe the bug
The firmware upload function is abnormal. The Select file function can be clicked, but no file is selected.

To Reproduce
Steps to reproduce the behavior:

  1. EMBArk installation (default mode/docker-mode)
  2. Start EMBArk: sudo ./run-server.sh

Expected behavior
When the installation is complete, upload functionality should be functional, if database errors do not affect it.

Screenshots
Upload firmware
Before selecting a file
图片
After selecting a bin file, nothing happens.
图片

Upload EMBA-Logs
图片

Desktop (please complete the following information):

  • OS: [e.g. Kali Linux 2022.04]

Additional context
The database login failure error was reported during the entire installation process, and there were no other err.
图片

In addition, after you submitted the optimization of the dashboard, the embark installation pulled from git always had some problems, such as the errors in the two screenshots below,
I tried to install and process them one by one, but it didn't work. Upgrading or installing incorrect or missing dependencies alone could not solve these errors. However, I pulled git and reinstalled again and again, and each time there were two results. , 1) reported the following two problems, 2) did not report the following two problems
My environment is the same, and the pulled embark resources are also the same, but two results did appear. I don’t know how they came about. This time, only a database error was reported during the installation, but the upload function did not work. More than Firmware upload, it seems that all upload functions are unavailable.
图片
图片

@BenediktMKuehne
Copy link
Member

To be able to help you 2 questions:

  1. which OS are you using? (EMBArk only supports Ubuntu 22.04 at the moment)
  2. is the embeddedanalyzer/emba image up-to-date? (docker pull embeddedanalyzer/emba:latest)

Regarding the upload:
is the file upload failing or does the upload button not work - is the POST request happening or not?

@BenediktMKuehne
Copy link
Member

We also currently are working on a major issue within EMBA in EMBA - PR913
Only once I can merge #172 will EMBArk work normally again

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

To be able to help you 2 questions:

1. which OS are you using? (EMBArk only supports Ubuntu 22.04 at the moment)

2. is the embeddedanalyzer/emba image up-to-date? (`docker pull embeddedanalyzer/emba:latest`)

Regarding the upload: is the file upload failing or does the upload button not work - is the POST request happening or not?

Yes, the OS is Ubuntu 22.04.
image

The tag for the embeddedanalyzer/emba image is latest.
image

Upload button doesn't work

@BenediktMKuehne
Copy link
Member

Good thank you

Are there any javascript errors from inside the browser when you select a file (e.g using the dev-options of the browser)?

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

Good thank you
Are there any javascript errors from inside the browser when you select a file (e.g using the dev-options of the browser)?

image

image

@BenediktMKuehne
Copy link
Member

This has to be a problem within the fileUpload.js, are there any console errors?

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

This has to be a problem within the fileUpload.js, are there any console errors?

Oh, so that's what it is. There's really an error.
image

Is it a problem here?
image

all have
image

But I downloaded it separately, not by executing installer.sh. The installer.sh process gets stuck here, and it's hard to get the download to work.
image

@BenediktMKuehne
Copy link
Member

In here EMBArk - fileUpload
Let me check real quick

If the jquery.js shows up in the sources inside the browser everything should be fine there

@BenediktMKuehne
Copy link
Member

yeah you definitely need all the sources to be downloaded into external/scripts

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

In here EMBArk - fileUpload Let me check real quick

If the jquery.js shows up in the sources inside the browser everything should be fine there

Ah, I don't understand. What am I supposed to do?

@BenediktMKuehne
Copy link
Member

BenediktMKuehne commented Nov 28, 2023

most likely there is a problem with the jquery.js

I would first check that the cat embark/static/external/jquery.js looks something like jquery-code

If it does we check what actually ends up in the browser

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

cat embark/static/external/jquery.js

I've zipped up the js and uploaded it so you can see if this is correct
/embark/static/external/scripts/jquery.js
jquery.zip

@BenediktMKuehne
Copy link
Member

Ok looks good

When you reload the upload page, does the jquery file show up and look the same?

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

Ok looks good

When you reload the upload page, does the jquery file show up and look the same?

Reload the upload page, all the resources are shown to be loaded normally, jquery also responded to the 200ok, but there is a strange phenomenon, the other js open can display the content, only jquery open nothing, in the jquery.js interface click to check the source code, the result is the same nothing to show!
image

@BenediktMKuehne
Copy link
Member

ok can you check if /var/www/embark/static/external/scripts/jquery.js has the expected content?

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

ok can you check if /var/www/embark/static/external/scripts/jquery.js has the expected content?

It's empty.
image

@BenediktMKuehne
Copy link
Member

hmm interesting are you on the current main branch?
the run-server script should always update newer files between the 2 folders

regardless you may just copy and overwrite /var/www/embark with ./embark since that's the one used for the SGIs

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

hmm interesting are you on the current main branch? the run-server script should always update newer files between the 2 folders

regardless you may just copy and overwrite /var/www/embark with ./embark since that's the one used for the SGIs

Yes, I just passed a jquery.js file from /embark/static/external/scripts and restarted run-server.sh, but the issue is still not resolved. In the background, the jquery.js file in /var/www/embark/static/external/scripts still has its content after restarting the server. However, the problem still persists on the interface and the upload functionality still does not work.

image
image

@BenediktMKuehne
Copy link
Member

Did you properly refresh and clear the cache?

Is the file still empty (from the web service/browser)? you could check the owner and permissions the file has insed /var/www

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

Did you properly refresh and clear the cache?

Is the file still empty (from the web service/browser)? you could check the owner and permissions the file has insed /var/www

The system cache is echo
1, clear the browser cache, turn off and restart the browser
2、Use no trace mode
3、Change a browser that has never been visited before
Still no solution
image

There's something in /var/www.
image

Gave attribution to root, restarted run_server.sh, still not resolved
image

@BenediktMKuehne
Copy link
Member

Ok this is weird, did you restart the server?

  • The apache server serves anything in /var/www/static/* as a static file
  • on restart the files from within embark get collected and copied into that folder
  • as long as the owner is www-embark and it has read permissions and copies them

question: if you put any random file in that folder (/var/www/static/external/scripts) during runtime it should be accessible from the browser. Can you test that?

Note: the WSGI logs are in /var/www/httpd80 and should indicate if there is an issue with serving static files

@yueqi77
Copy link
Author

yueqi77 commented Nov 28, 2023

Ok this is weird, did you restart the server?

* The apache server serves anything in /var/www/static/* as a static file

* on restart the files from within embark get collected and copied into that folder

* as long as the owner is www-embark and it has read permissions and copies them

question: if you put any random file in that folder (/var/www/static/external/scripts) during runtime it should be accessible from the browser. Can you test that?

Note: the WSGI logs are in /var/www/httpd80 and should indicate if there is an issue with serving static files

Yes, on reboot they were copied, so for them the changes were reverted, but in /var/www..... /jquery.js has always had content now

Okay , the test result is that a reboot is required to access the written file

image
image
image

err_log
The client IP for coding is my local address.
image

@BenediktMKuehne
Copy link
Member

Yes, outside the developer installation mode all changes only take effect after restarting the run-server.sh script.
All server files have to be owned by that www-embark, it gets changed on startup.

Does the upload work now with the restart?

err_log - looks unrelated

@yueqi77
Copy link
Author

yueqi77 commented Nov 29, 2023

Yes, outside the developer installation mode all changes only take effect after restarting the run-server.sh script. All server files have to be owned by that www-embark, it gets changed on startup.

Does the upload work now with the restart?

err_log - looks unrelated

Still having problems uploading after reboot (loudly crying face)

@BenediktMKuehne
Copy link
Member

Are the static files (jquery.js etc) working now?

@yueqi77
Copy link
Author

yueqi77 commented Nov 29, 2023

Are the static files (jquery.js etc) working now?

Can't

@yueqi77
Copy link
Author

yueqi77 commented Nov 29, 2023

Thank God I just made up my mind to reinstall and it !!!! Passed in one go ah ah ah ah ah !!!!!!! Super excited, well the upload works yay !!!!!!
However, the execution reported an error (weeping)
Does this mean that there are two directories missing in the scan task directory: /emba_logs/emba.log?
image
image

@BenediktMKuehne
Copy link
Member

BenediktMKuehne commented Nov 29, 2023

I'm guessing missing www-embark user or missing entry into /etc/sudoers/

just re-run these commands
user creation

to test sudo su www-embark -s /bin/bash and try to execute emba: /var/www/emba/emba -d 1

Context: www-embark has to be able to execute 2 commands as root without password prompt

@yueqi77
Copy link
Author

yueqi77 commented Nov 30, 2023

I'm guessing missing www-embark user or missing entry into /etc/sudoers/

just re-run these commands user creation

to test sudo su www-embark -s /bin/bash and try to execute emba: /var/www/emba/emba -d 1

Context: www-embark has to be able to execute 2 commands as root without password prompt

The www-embark user exists, no /etc/sudoers/ directory
image
image

I re-executed these two commands:
echo 'www-embark ALL=(ALL) NOPASSWD: /var/www/emba/emba' | EDITOR='tee -a' visudo
echo 'www-embark ALL=(ALL) NOPASSWD: /bin/pkill' | EDITOR='tee -a' visudo
And then execute
sudo su www-embark -s /bin/bash,smooth execution without password entry
/var/www/emba/emba -d 1,I had to add sudo to avoid a privilege error and complete the execution without entering a password, but it still gave me an emba error, as shown below.
image
image

@yueqi77
Copy link
Author

yueqi77 commented Nov 30, 2023

I switched to that directory and it worked!
image

The scan task is starting up fine! Progress has been advancing, there seems to be no problem, the error log is still that my client's message, please see my following screenshot of the scan progress, I crossed out the box that time, what does this time mean ah, the green message of the time seems to be all the time in the future, oh, this should not have an impact on the scan results, right?

image
image

@yueqi77
Copy link
Author

yueqi77 commented Nov 30, 2023

Oops, this scan went off without a hitch, but without a picture, how do I go about messing with this one?
image

@BenediktMKuehne
Copy link
Member

Any error messages in the browser?
Looks like a problem on the client-side

@yueqi77
Copy link
Author

yueqi77 commented Nov 30, 2023

Any error messages in the browser?
Looks like a problem on the client-side
Ah, still this jquery.js
image

@BenediktMKuehne
Copy link
Member

BenediktMKuehne commented Nov 30, 2023

Likely the charts.js

At this point I would check all your static/external scripts

Code from here:
Installer-external scipts

@yueqi77
Copy link
Author

yueqi77 commented Nov 30, 2023

Likely the charts.js

At this point I would check all your static/external scripts

Code from here: Installer-external scipts
My God, it's empty!
image

I downloaded it, oh my god! I finally got it all working, Installing this was truly like experiencing nine thousand nine hundred eighty-one challenges, it was really difficult (sobbing intensely).
Thank you so much for your patience and guidance, finally I can use the famous emba, oh yeah!
hahahaha I have installed emba before, it is also a very memorable experience, it is the background command to perform a scan, I think it takes a long time, But going through embark and using emba is quick, almost an hour to scan through it, in short, there is a web is very convenient hahahahaha, thank you oh!
image

@BenediktMKuehne
Copy link
Member

Always happy to help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants