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

Parts Update Results In "Unable to open temporary file" #3308

Closed
ghoss opened this Issue Jan 31, 2017 · 20 comments

Comments

Projects
None yet
@ghoss

ghoss commented Jan 31, 2017

Version 0.9.3, fresh install on Mac OSX 10.9.5

When I select Help > Check for updates, I get informed that a new parts library update is available. Fritzing then displays a progress window "Downloading new parts", and once finished, I get this error message:

Sorry, unable to install new parts: Unable to open temporary file
Fritzing must nevertheless be restarted, so the "Close" button will close Fritzing.

Upon restarting Fritzing, I get this error:

Unable to find the following 13 parts:
'4001_4_x_2_input_NOR_gate_single' at ''
'JST-B3P-VH' at 'JST-B3P-VH.fzp'
'4070_4_x_2_input_XOR_gate_multipart' at ''
… (and so on)

The app will then continue to start up normally. If I select Help > Check for updates again, this time I get the error:

The parts folder '/Applications/Fritzing.app/Contents/MacOS/fritzing-parts' has been changed (4)
Fritzing cannot update the parts folder automatically.
If you used to git to make changes, use git to update and then regenerate the database by
selecting Part > Regenerate parts database…
If you did not use git to make changes, then you may need to reinstall Fritzing.

If I select Part > Regenerate parts database, I get the error

Unable to open temporary file.

I also reinstalled the app (and deleted the preferences file org.fritzing.Fritzing.plist and the config data in ~/.config/Fritzing before doing so). Same errors.

Any ideas?

@tempidoro

This comment has been minimized.

Show comment
Hide comment
@tempidoro

tempidoro Feb 18, 2017

This is exactly also what I experienced. I need help

tempidoro commented Feb 18, 2017

This is exactly also what I experienced. I need help

@tempidoro

This comment has been minimized.

Show comment
Hide comment
@tempidoro

tempidoro Feb 18, 2017

I applied the suggestion given at
http://stackoverflow.com/questions/22661459/osx-with-xampp-imagegd2-unable-to-open-temporary-file
within another problem discussion.
it worked for me also in our case

tempidoro commented Feb 18, 2017

I applied the suggestion given at
http://stackoverflow.com/questions/22661459/osx-with-xampp-imagegd2-unable-to-open-temporary-file
within another problem discussion.
it worked for me also in our case

@ghoss

This comment has been minimized.

Show comment
Hide comment
@ghoss

ghoss Feb 18, 2017

@tempidoro Thanks for your help, and I can confirm that the workaround at stackoverflow.com indeed solves the problem for me too.

In short, open a shell in Terminal and type the command

chmod 777 ${TMPDIR}

(The original article suggests chmod -R, which would recursively change all file permissions in the temporary folder, but I found that it was sufficient to change the permission of the top level folder itself)

ghoss commented Feb 18, 2017

@tempidoro Thanks for your help, and I can confirm that the workaround at stackoverflow.com indeed solves the problem for me too.

In short, open a shell in Terminal and type the command

chmod 777 ${TMPDIR}

(The original article suggests chmod -R, which would recursively change all file permissions in the temporary folder, but I found that it was sufficient to change the permission of the top level folder itself)

@Teddy68

This comment has been minimized.

Show comment
Hide comment
@Teddy68

Teddy68 Mar 28, 2017

Hi all,

I had exactly the same problem in Mountain Lion.
I first installed the Fritzing application in another folder than "Applications", because already over-crowded, grouped with other development tools. At this point, I found none of the tricks provided in this discussion to fix the problem.

Considering this :

The parts folder '/Applications/Fritzing.app/Contents/MacOS/fritzing-parts' has been changed (4)

which is definitely not the place of my installation, I imagine Fritzing to be hard-coded to this location and not able to work elsewhere.
Then dropped Fritzing in the regular "Applications" folder, and there works like a charm.

Regards

Teddy68 commented Mar 28, 2017

Hi all,

I had exactly the same problem in Mountain Lion.
I first installed the Fritzing application in another folder than "Applications", because already over-crowded, grouped with other development tools. At this point, I found none of the tricks provided in this discussion to fix the problem.

Considering this :

The parts folder '/Applications/Fritzing.app/Contents/MacOS/fritzing-parts' has been changed (4)

which is definitely not the place of my installation, I imagine Fritzing to be hard-coded to this location and not able to work elsewhere.
Then dropped Fritzing in the regular "Applications" folder, and there works like a charm.

Regards

@joshbg2k

This comment has been minimized.

Show comment
Hide comment
@joshbg2k

joshbg2k Apr 19, 2017

I currently have this issue and neither of the above fixes has worked.

joshbg2k commented Apr 19, 2017

I currently have this issue and neither of the above fixes has worked.

@joeljacobs

This comment has been minimized.

Show comment
Hide comment
@joeljacobs

joeljacobs May 9, 2017

I have tried both fixes as well and have the same problem on MacOS Sierra.

joeljacobs commented May 9, 2017

I have tried both fixes as well and have the same problem on MacOS Sierra.

@joeljacobs

This comment has been minimized.

Show comment
Hide comment
@joeljacobs

joeljacobs May 9, 2017

I found a solution. It looks like the QT temporary file call is misbehaving on a Mac. Instead of using the correct temporary folder, it uses / when launched from finder. Seems to be a bug in QT:

https://bugreports.qt.io/browse/QTBUG-56807

I was able to get mine to update by opening Fritzing from the command-line:
/Applications/Fritzing.app/Contents/MacOS/Fritzing

It then successfully updated.

joeljacobs commented May 9, 2017

I found a solution. It looks like the QT temporary file call is misbehaving on a Mac. Instead of using the correct temporary folder, it uses / when launched from finder. Seems to be a bug in QT:

https://bugreports.qt.io/browse/QTBUG-56807

I was able to get mine to update by opening Fritzing from the command-line:
/Applications/Fritzing.app/Contents/MacOS/Fritzing

It then successfully updated.

@nopdotcom

This comment has been minimized.

Show comment
Hide comment
@nopdotcom

nopdotcom Jul 20, 2017

Contributor

Say, what is a new binary release of fritzing blocking on?

Contributor

nopdotcom commented Jul 20, 2017

Say, what is a new binary release of fritzing blocking on?

@esaheiskanen

This comment has been minimized.

Show comment
Hide comment
@esaheiskanen

esaheiskanen Aug 30, 2017

@joeljacobs solution did not work for me, mut when start fritzing from command-line with sudo it works. Not pretty, but it works.
sudo /Applications/Fritzing.app/Contents/MacOS/Fritzing

esaheiskanen commented Aug 30, 2017

@joeljacobs solution did not work for me, mut when start fritzing from command-line with sudo it works. Not pretty, but it works.
sudo /Applications/Fritzing.app/Contents/MacOS/Fritzing

@HartmannNico

This comment has been minimized.

Show comment
Hide comment
@HartmannNico

HartmannNico Sep 25, 2017

I did this:

Copy Fritzing from .dmg to desktop folder (uaaah!).
Run the tool from desktop
Update works fine. Restart works fine.
Move everything to /Applications
Awful but effective.
However: 'Regenerate parts database...' will still bring up 'Unable to open temporary file'.

HartmannNico commented Sep 25, 2017

I did this:

Copy Fritzing from .dmg to desktop folder (uaaah!).
Run the tool from desktop
Update works fine. Restart works fine.
Move everything to /Applications
Awful but effective.
However: 'Regenerate parts database...' will still bring up 'Unable to open temporary file'.

@i0ntempest

This comment has been minimized.

Show comment
Hide comment
@i0ntempest

i0ntempest Nov 23, 2017

+1 on this issue. Running the app using Terminal solved the problem

i0ntempest commented Nov 23, 2017

+1 on this issue. Running the app using Terminal solved the problem

@securelpb

This comment has been minimized.

Show comment
Hide comment
@securelpb

securelpb Nov 24, 2017

I can confirm that running from command line per joeljacobs's suggestion works. No sudo required.

securelpb commented Nov 24, 2017

I can confirm that running from command line per joeljacobs's suggestion works. No sudo required.

@dlemper

This comment has been minimized.

Show comment
Hide comment
@dlemper

dlemper Dec 14, 2017

Contributor

Seems like Fritzing is using current working directory as a temp dir on macOS.
When you open the application via Finder it gets '/' as the current working directory and there Fritzing doesn't have enough rights to create the temporary database for the parts.

For me it just worked like @securelpb wrote: run Fritzing from Terminal without sudo like this
$ /Applications/Fritzing.app/Contents/MacOS/Fritzing

Contributor

dlemper commented Dec 14, 2017

Seems like Fritzing is using current working directory as a temp dir on macOS.
When you open the application via Finder it gets '/' as the current working directory and there Fritzing doesn't have enough rights to create the temporary database for the parts.

For me it just worked like @securelpb wrote: run Fritzing from Terminal without sudo like this
$ /Applications/Fritzing.app/Contents/MacOS/Fritzing

@dlemper

This comment has been minimized.

Show comment
Hide comment
@dlemper

dlemper Dec 14, 2017

Contributor

OK, I had a look at the source code and the bug seems to be the following:
In this line

QTemporaryFile file("XXXXXX.db");

the temp file gets created under the current working directory as the docs of Qt tell you here
http://doc.qt.io/qt-5/qtemporaryfile.html#QTemporaryFile-1
This behaviour could be fixed with one of the following solutions:

  1. create a QTemporaryFile without any parameter (QTemporaryFile file();) as it will create a temp file in the temp dir of the operating system using random characters, but then it won't have the '.db' file extension (which isn't necessary in my opinion)
  2. add QDir::tempPath() to the filename (QTemporaryFile file(QString("%1/XXXXXX.db").arg(QDir::tempPath()));).
Contributor

dlemper commented Dec 14, 2017

OK, I had a look at the source code and the bug seems to be the following:
In this line

QTemporaryFile file("XXXXXX.db");

the temp file gets created under the current working directory as the docs of Qt tell you here
http://doc.qt.io/qt-5/qtemporaryfile.html#QTemporaryFile-1
This behaviour could be fixed with one of the following solutions:

  1. create a QTemporaryFile without any parameter (QTemporaryFile file();) as it will create a temp file in the temp dir of the operating system using random characters, but then it won't have the '.db' file extension (which isn't necessary in my opinion)
  2. add QDir::tempPath() to the filename (QTemporaryFile file(QString("%1/XXXXXX.db").arg(QDir::tempPath()));).

dlemper added a commit to dlemper/fritzing-app that referenced this issue Dec 14, 2017

@aknoerig

This comment has been minimized.

Show comment
Hide comment
@aknoerig

aknoerig Dec 18, 2017

Member

Nice catch, thanks! It's now merged, hope this solution can be confirmed by everybody.

Member

aknoerig commented Dec 18, 2017

Nice catch, thanks! It's now merged, hope this solution can be confirmed by everybody.

@aknoerig aknoerig closed this Dec 18, 2017

@tempidoro

This comment has been minimized.

Show comment
Hide comment
@tempidoro

tempidoro Dec 27, 2017

Hi,
I suppose that "It's now merged" from aknoering means that downloading Fritzing and updating Fritzing parts should work now. Sorry for this. I'm not expert about this stuff.
At the moment I copied Fritzing parts from the fritzing-parts-master and I substitute this parts to the one already in App folder.
Fritzing now works with the parts I tried to update.
However, after the first working session, it do not work anymore when I reopen it.
If I delete the file parts.db before the new fritzing opening, it works again.
At moment I'm using Fritzing in this unconfortable way.

tempidoro commented Dec 27, 2017

Hi,
I suppose that "It's now merged" from aknoering means that downloading Fritzing and updating Fritzing parts should work now. Sorry for this. I'm not expert about this stuff.
At the moment I copied Fritzing parts from the fritzing-parts-master and I substitute this parts to the one already in App folder.
Fritzing now works with the parts I tried to update.
However, after the first working session, it do not work anymore when I reopen it.
If I delete the file parts.db before the new fritzing opening, it works again.
At moment I'm using Fritzing in this unconfortable way.

@Intrinsically-Sublime

This comment has been minimized.

Show comment
Hide comment
@Intrinsically-Sublime

Intrinsically-Sublime Dec 27, 2017

Contributor

@tempidoro that fix will not be available to you until the next release of Fritzing unless you compile it from source.

Contributor

Intrinsically-Sublime commented Dec 27, 2017

@tempidoro that fix will not be available to you until the next release of Fritzing unless you compile it from source.

@echristopherson

This comment has been minimized.

Show comment
Hide comment
@echristopherson

echristopherson Mar 16, 2018

I get the same thing on Windows 10 x64 (and yes, I had it on OS X before that too). I tried both

  • giving myself full access recursively to the fritzing-parts folder; and
  • changing the working directory of the Start Menu shortcut for Fritzing to my user temp directory.
    Neither one made any difference.

As an aside, the Help > About menu item says my version is "Version 0.9.3 (b5c895d327c44a3114e5fcc9d8260daf0cbb52806 2016-04-19) 64 [Qt 5.6.1]", but the installer was for 0.9.3b and I can't find a commit b5c895d327c44a3114e5fcc9d8260daf0cbb52806 anywhere in the repository.

echristopherson commented Mar 16, 2018

I get the same thing on Windows 10 x64 (and yes, I had it on OS X before that too). I tried both

  • giving myself full access recursively to the fritzing-parts folder; and
  • changing the working directory of the Start Menu shortcut for Fritzing to my user temp directory.
    Neither one made any difference.

As an aside, the Help > About menu item says my version is "Version 0.9.3 (b5c895d327c44a3114e5fcc9d8260daf0cbb52806 2016-04-19) 64 [Qt 5.6.1]", but the installer was for 0.9.3b and I can't find a commit b5c895d327c44a3114e5fcc9d8260daf0cbb52806 anywhere in the repository.

@wcoburn

This comment has been minimized.

Show comment
Hide comment
@wcoburn

wcoburn Mar 23, 2018

@Intrinsically-Sublime Do you know if there's a plan for another official release, and if so when it might happen? The version on the fritizing.org website dates back to June 2016.

wcoburn commented Mar 23, 2018

@Intrinsically-Sublime Do you know if there's a plan for another official release, and if so when it might happen? The version on the fritizing.org website dates back to June 2016.

@Intrinsically-Sublime

This comment has been minimized.

Show comment
Hide comment
@Intrinsically-Sublime

Intrinsically-Sublime Mar 23, 2018

Contributor

I am only a user but I do spend a lot of time on the Fritzing forum and from what I can gather the main developers are working on porting over the code base from QT to web technologies resulting in little work being done to the main application. All of this is only speculation and should not be taken as fact. The only one that could tell us exactly when and how the next version will be released is @aknoerig.

I am running the testing branch of my fork on a daily basis and I can say it does fix a few things while introducing new bugs. Things like popup dialogs are no longer being brought to the front so you don't even know they are there unless you minimize the application.

Contributor

Intrinsically-Sublime commented Mar 23, 2018

I am only a user but I do spend a lot of time on the Fritzing forum and from what I can gather the main developers are working on porting over the code base from QT to web technologies resulting in little work being done to the main application. All of this is only speculation and should not be taken as fact. The only one that could tell us exactly when and how the next version will be released is @aknoerig.

I am running the testing branch of my fork on a daily basis and I can say it does fix a few things while introducing new bugs. Things like popup dialogs are no longer being brought to the front so you don't even know they are there unless you minimize the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment